spirc.rs 141 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161
  1. // This file is generated by rust-protobuf 2.8.1. Do not edit
  2. // @generated
  3. // https://github.com/Manishearth/rust-clippy/issues/702
  4. #![allow(unknown_lints)]
  5. #![allow(clippy::all)]
  6. #![cfg_attr(rustfmt, rustfmt_skip)]
  7. #![allow(box_pointers)]
  8. #![allow(dead_code)]
  9. #![allow(missing_docs)]
  10. #![allow(non_camel_case_types)]
  11. #![allow(non_snake_case)]
  12. #![allow(non_upper_case_globals)]
  13. #![allow(trivial_casts)]
  14. #![allow(unsafe_code)]
  15. #![allow(unused_imports)]
  16. #![allow(unused_results)]
  17. //! Generated file from `spirc.proto`
  18. use protobuf::Message as Message_imported_for_functions;
  19. use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
  20. /// Generated files are compatible only with the same version
  21. /// of protobuf runtime.
  22. const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_1;
  23. #[derive(PartialEq,Clone,Default)]
  24. pub struct Frame {
  25. // message fields
  26. version: ::std::option::Option<u32>,
  27. ident: ::protobuf::SingularField<::std::string::String>,
  28. protocol_version: ::protobuf::SingularField<::std::string::String>,
  29. seq_nr: ::std::option::Option<u32>,
  30. typ: ::std::option::Option<MessageType>,
  31. device_state: ::protobuf::SingularPtrField<DeviceState>,
  32. goodbye: ::protobuf::SingularPtrField<Goodbye>,
  33. state: ::protobuf::SingularPtrField<State>,
  34. position: ::std::option::Option<u32>,
  35. volume: ::std::option::Option<u32>,
  36. state_update_id: ::std::option::Option<i64>,
  37. recipient: ::protobuf::RepeatedField<::std::string::String>,
  38. context_player_state: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  39. new_name: ::protobuf::SingularField<::std::string::String>,
  40. metadata: ::protobuf::SingularPtrField<Metadata>,
  41. // special fields
  42. pub unknown_fields: ::protobuf::UnknownFields,
  43. pub cached_size: ::protobuf::CachedSize,
  44. }
  45. impl<'a> ::std::default::Default for &'a Frame {
  46. fn default() -> &'a Frame {
  47. <Frame as ::protobuf::Message>::default_instance()
  48. }
  49. }
  50. impl Frame {
  51. pub fn new() -> Frame {
  52. ::std::default::Default::default()
  53. }
  54. // optional uint32 version = 1;
  55. pub fn get_version(&self) -> u32 {
  56. self.version.unwrap_or(0)
  57. }
  58. pub fn clear_version(&mut self) {
  59. self.version = ::std::option::Option::None;
  60. }
  61. pub fn has_version(&self) -> bool {
  62. self.version.is_some()
  63. }
  64. // Param is passed by value, moved
  65. pub fn set_version(&mut self, v: u32) {
  66. self.version = ::std::option::Option::Some(v);
  67. }
  68. // optional string ident = 2;
  69. pub fn get_ident(&self) -> &str {
  70. match self.ident.as_ref() {
  71. Some(v) => &v,
  72. None => "",
  73. }
  74. }
  75. pub fn clear_ident(&mut self) {
  76. self.ident.clear();
  77. }
  78. pub fn has_ident(&self) -> bool {
  79. self.ident.is_some()
  80. }
  81. // Param is passed by value, moved
  82. pub fn set_ident(&mut self, v: ::std::string::String) {
  83. self.ident = ::protobuf::SingularField::some(v);
  84. }
  85. // Mutable pointer to the field.
  86. // If field is not initialized, it is initialized with default value first.
  87. pub fn mut_ident(&mut self) -> &mut ::std::string::String {
  88. if self.ident.is_none() {
  89. self.ident.set_default();
  90. }
  91. self.ident.as_mut().unwrap()
  92. }
  93. // Take field
  94. pub fn take_ident(&mut self) -> ::std::string::String {
  95. self.ident.take().unwrap_or_else(|| ::std::string::String::new())
  96. }
  97. // optional string protocol_version = 3;
  98. pub fn get_protocol_version(&self) -> &str {
  99. match self.protocol_version.as_ref() {
  100. Some(v) => &v,
  101. None => "",
  102. }
  103. }
  104. pub fn clear_protocol_version(&mut self) {
  105. self.protocol_version.clear();
  106. }
  107. pub fn has_protocol_version(&self) -> bool {
  108. self.protocol_version.is_some()
  109. }
  110. // Param is passed by value, moved
  111. pub fn set_protocol_version(&mut self, v: ::std::string::String) {
  112. self.protocol_version = ::protobuf::SingularField::some(v);
  113. }
  114. // Mutable pointer to the field.
  115. // If field is not initialized, it is initialized with default value first.
  116. pub fn mut_protocol_version(&mut self) -> &mut ::std::string::String {
  117. if self.protocol_version.is_none() {
  118. self.protocol_version.set_default();
  119. }
  120. self.protocol_version.as_mut().unwrap()
  121. }
  122. // Take field
  123. pub fn take_protocol_version(&mut self) -> ::std::string::String {
  124. self.protocol_version.take().unwrap_or_else(|| ::std::string::String::new())
  125. }
  126. // optional uint32 seq_nr = 4;
  127. pub fn get_seq_nr(&self) -> u32 {
  128. self.seq_nr.unwrap_or(0)
  129. }
  130. pub fn clear_seq_nr(&mut self) {
  131. self.seq_nr = ::std::option::Option::None;
  132. }
  133. pub fn has_seq_nr(&self) -> bool {
  134. self.seq_nr.is_some()
  135. }
  136. // Param is passed by value, moved
  137. pub fn set_seq_nr(&mut self, v: u32) {
  138. self.seq_nr = ::std::option::Option::Some(v);
  139. }
  140. // optional .MessageType typ = 5;
  141. pub fn get_typ(&self) -> MessageType {
  142. self.typ.unwrap_or(MessageType::kMessageTypeHello)
  143. }
  144. pub fn clear_typ(&mut self) {
  145. self.typ = ::std::option::Option::None;
  146. }
  147. pub fn has_typ(&self) -> bool {
  148. self.typ.is_some()
  149. }
  150. // Param is passed by value, moved
  151. pub fn set_typ(&mut self, v: MessageType) {
  152. self.typ = ::std::option::Option::Some(v);
  153. }
  154. // optional .DeviceState device_state = 7;
  155. pub fn get_device_state(&self) -> &DeviceState {
  156. self.device_state.as_ref().unwrap_or_else(|| DeviceState::default_instance())
  157. }
  158. pub fn clear_device_state(&mut self) {
  159. self.device_state.clear();
  160. }
  161. pub fn has_device_state(&self) -> bool {
  162. self.device_state.is_some()
  163. }
  164. // Param is passed by value, moved
  165. pub fn set_device_state(&mut self, v: DeviceState) {
  166. self.device_state = ::protobuf::SingularPtrField::some(v);
  167. }
  168. // Mutable pointer to the field.
  169. // If field is not initialized, it is initialized with default value first.
  170. pub fn mut_device_state(&mut self) -> &mut DeviceState {
  171. if self.device_state.is_none() {
  172. self.device_state.set_default();
  173. }
  174. self.device_state.as_mut().unwrap()
  175. }
  176. // Take field
  177. pub fn take_device_state(&mut self) -> DeviceState {
  178. self.device_state.take().unwrap_or_else(|| DeviceState::new())
  179. }
  180. // optional .Goodbye goodbye = 11;
  181. pub fn get_goodbye(&self) -> &Goodbye {
  182. self.goodbye.as_ref().unwrap_or_else(|| Goodbye::default_instance())
  183. }
  184. pub fn clear_goodbye(&mut self) {
  185. self.goodbye.clear();
  186. }
  187. pub fn has_goodbye(&self) -> bool {
  188. self.goodbye.is_some()
  189. }
  190. // Param is passed by value, moved
  191. pub fn set_goodbye(&mut self, v: Goodbye) {
  192. self.goodbye = ::protobuf::SingularPtrField::some(v);
  193. }
  194. // Mutable pointer to the field.
  195. // If field is not initialized, it is initialized with default value first.
  196. pub fn mut_goodbye(&mut self) -> &mut Goodbye {
  197. if self.goodbye.is_none() {
  198. self.goodbye.set_default();
  199. }
  200. self.goodbye.as_mut().unwrap()
  201. }
  202. // Take field
  203. pub fn take_goodbye(&mut self) -> Goodbye {
  204. self.goodbye.take().unwrap_or_else(|| Goodbye::new())
  205. }
  206. // optional .State state = 12;
  207. pub fn get_state(&self) -> &State {
  208. self.state.as_ref().unwrap_or_else(|| State::default_instance())
  209. }
  210. pub fn clear_state(&mut self) {
  211. self.state.clear();
  212. }
  213. pub fn has_state(&self) -> bool {
  214. self.state.is_some()
  215. }
  216. // Param is passed by value, moved
  217. pub fn set_state(&mut self, v: State) {
  218. self.state = ::protobuf::SingularPtrField::some(v);
  219. }
  220. // Mutable pointer to the field.
  221. // If field is not initialized, it is initialized with default value first.
  222. pub fn mut_state(&mut self) -> &mut State {
  223. if self.state.is_none() {
  224. self.state.set_default();
  225. }
  226. self.state.as_mut().unwrap()
  227. }
  228. // Take field
  229. pub fn take_state(&mut self) -> State {
  230. self.state.take().unwrap_or_else(|| State::new())
  231. }
  232. // optional uint32 position = 13;
  233. pub fn get_position(&self) -> u32 {
  234. self.position.unwrap_or(0)
  235. }
  236. pub fn clear_position(&mut self) {
  237. self.position = ::std::option::Option::None;
  238. }
  239. pub fn has_position(&self) -> bool {
  240. self.position.is_some()
  241. }
  242. // Param is passed by value, moved
  243. pub fn set_position(&mut self, v: u32) {
  244. self.position = ::std::option::Option::Some(v);
  245. }
  246. // optional uint32 volume = 14;
  247. pub fn get_volume(&self) -> u32 {
  248. self.volume.unwrap_or(0)
  249. }
  250. pub fn clear_volume(&mut self) {
  251. self.volume = ::std::option::Option::None;
  252. }
  253. pub fn has_volume(&self) -> bool {
  254. self.volume.is_some()
  255. }
  256. // Param is passed by value, moved
  257. pub fn set_volume(&mut self, v: u32) {
  258. self.volume = ::std::option::Option::Some(v);
  259. }
  260. // optional int64 state_update_id = 17;
  261. pub fn get_state_update_id(&self) -> i64 {
  262. self.state_update_id.unwrap_or(0)
  263. }
  264. pub fn clear_state_update_id(&mut self) {
  265. self.state_update_id = ::std::option::Option::None;
  266. }
  267. pub fn has_state_update_id(&self) -> bool {
  268. self.state_update_id.is_some()
  269. }
  270. // Param is passed by value, moved
  271. pub fn set_state_update_id(&mut self, v: i64) {
  272. self.state_update_id = ::std::option::Option::Some(v);
  273. }
  274. // repeated string recipient = 18;
  275. pub fn get_recipient(&self) -> &[::std::string::String] {
  276. &self.recipient
  277. }
  278. pub fn clear_recipient(&mut self) {
  279. self.recipient.clear();
  280. }
  281. // Param is passed by value, moved
  282. pub fn set_recipient(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
  283. self.recipient = v;
  284. }
  285. // Mutable pointer to the field.
  286. pub fn mut_recipient(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
  287. &mut self.recipient
  288. }
  289. // Take field
  290. pub fn take_recipient(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
  291. ::std::mem::replace(&mut self.recipient, ::protobuf::RepeatedField::new())
  292. }
  293. // optional bytes context_player_state = 19;
  294. pub fn get_context_player_state(&self) -> &[u8] {
  295. match self.context_player_state.as_ref() {
  296. Some(v) => &v,
  297. None => &[],
  298. }
  299. }
  300. pub fn clear_context_player_state(&mut self) {
  301. self.context_player_state.clear();
  302. }
  303. pub fn has_context_player_state(&self) -> bool {
  304. self.context_player_state.is_some()
  305. }
  306. // Param is passed by value, moved
  307. pub fn set_context_player_state(&mut self, v: ::std::vec::Vec<u8>) {
  308. self.context_player_state = ::protobuf::SingularField::some(v);
  309. }
  310. // Mutable pointer to the field.
  311. // If field is not initialized, it is initialized with default value first.
  312. pub fn mut_context_player_state(&mut self) -> &mut ::std::vec::Vec<u8> {
  313. if self.context_player_state.is_none() {
  314. self.context_player_state.set_default();
  315. }
  316. self.context_player_state.as_mut().unwrap()
  317. }
  318. // Take field
  319. pub fn take_context_player_state(&mut self) -> ::std::vec::Vec<u8> {
  320. self.context_player_state.take().unwrap_or_else(|| ::std::vec::Vec::new())
  321. }
  322. // optional string new_name = 20;
  323. pub fn get_new_name(&self) -> &str {
  324. match self.new_name.as_ref() {
  325. Some(v) => &v,
  326. None => "",
  327. }
  328. }
  329. pub fn clear_new_name(&mut self) {
  330. self.new_name.clear();
  331. }
  332. pub fn has_new_name(&self) -> bool {
  333. self.new_name.is_some()
  334. }
  335. // Param is passed by value, moved
  336. pub fn set_new_name(&mut self, v: ::std::string::String) {
  337. self.new_name = ::protobuf::SingularField::some(v);
  338. }
  339. // Mutable pointer to the field.
  340. // If field is not initialized, it is initialized with default value first.
  341. pub fn mut_new_name(&mut self) -> &mut ::std::string::String {
  342. if self.new_name.is_none() {
  343. self.new_name.set_default();
  344. }
  345. self.new_name.as_mut().unwrap()
  346. }
  347. // Take field
  348. pub fn take_new_name(&mut self) -> ::std::string::String {
  349. self.new_name.take().unwrap_or_else(|| ::std::string::String::new())
  350. }
  351. // optional .Metadata metadata = 25;
  352. pub fn get_metadata(&self) -> &Metadata {
  353. self.metadata.as_ref().unwrap_or_else(|| Metadata::default_instance())
  354. }
  355. pub fn clear_metadata(&mut self) {
  356. self.metadata.clear();
  357. }
  358. pub fn has_metadata(&self) -> bool {
  359. self.metadata.is_some()
  360. }
  361. // Param is passed by value, moved
  362. pub fn set_metadata(&mut self, v: Metadata) {
  363. self.metadata = ::protobuf::SingularPtrField::some(v);
  364. }
  365. // Mutable pointer to the field.
  366. // If field is not initialized, it is initialized with default value first.
  367. pub fn mut_metadata(&mut self) -> &mut Metadata {
  368. if self.metadata.is_none() {
  369. self.metadata.set_default();
  370. }
  371. self.metadata.as_mut().unwrap()
  372. }
  373. // Take field
  374. pub fn take_metadata(&mut self) -> Metadata {
  375. self.metadata.take().unwrap_or_else(|| Metadata::new())
  376. }
  377. }
  378. impl ::protobuf::Message for Frame {
  379. fn is_initialized(&self) -> bool {
  380. for v in &self.device_state {
  381. if !v.is_initialized() {
  382. return false;
  383. }
  384. };
  385. for v in &self.goodbye {
  386. if !v.is_initialized() {
  387. return false;
  388. }
  389. };
  390. for v in &self.state {
  391. if !v.is_initialized() {
  392. return false;
  393. }
  394. };
  395. for v in &self.metadata {
  396. if !v.is_initialized() {
  397. return false;
  398. }
  399. };
  400. true
  401. }
  402. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  403. while !is.eof()? {
  404. let (field_number, wire_type) = is.read_tag_unpack()?;
  405. match field_number {
  406. 1 => {
  407. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  408. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  409. }
  410. let tmp = is.read_uint32()?;
  411. self.version = ::std::option::Option::Some(tmp);
  412. },
  413. 2 => {
  414. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.ident)?;
  415. },
  416. 3 => {
  417. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.protocol_version)?;
  418. },
  419. 4 => {
  420. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  421. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  422. }
  423. let tmp = is.read_uint32()?;
  424. self.seq_nr = ::std::option::Option::Some(tmp);
  425. },
  426. 5 => {
  427. ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.typ, 5, &mut self.unknown_fields)?
  428. },
  429. 7 => {
  430. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.device_state)?;
  431. },
  432. 11 => {
  433. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.goodbye)?;
  434. },
  435. 12 => {
  436. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.state)?;
  437. },
  438. 13 => {
  439. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  440. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  441. }
  442. let tmp = is.read_uint32()?;
  443. self.position = ::std::option::Option::Some(tmp);
  444. },
  445. 14 => {
  446. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  447. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  448. }
  449. let tmp = is.read_uint32()?;
  450. self.volume = ::std::option::Option::Some(tmp);
  451. },
  452. 17 => {
  453. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  454. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  455. }
  456. let tmp = is.read_int64()?;
  457. self.state_update_id = ::std::option::Option::Some(tmp);
  458. },
  459. 18 => {
  460. ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.recipient)?;
  461. },
  462. 19 => {
  463. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.context_player_state)?;
  464. },
  465. 20 => {
  466. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.new_name)?;
  467. },
  468. 25 => {
  469. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.metadata)?;
  470. },
  471. _ => {
  472. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  473. },
  474. };
  475. }
  476. ::std::result::Result::Ok(())
  477. }
  478. // Compute sizes of nested messages
  479. #[allow(unused_variables)]
  480. fn compute_size(&self) -> u32 {
  481. let mut my_size = 0;
  482. if let Some(v) = self.version {
  483. my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
  484. }
  485. if let Some(ref v) = self.ident.as_ref() {
  486. my_size += ::protobuf::rt::string_size(2, &v);
  487. }
  488. if let Some(ref v) = self.protocol_version.as_ref() {
  489. my_size += ::protobuf::rt::string_size(3, &v);
  490. }
  491. if let Some(v) = self.seq_nr {
  492. my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint);
  493. }
  494. if let Some(v) = self.typ {
  495. my_size += ::protobuf::rt::enum_size(5, v);
  496. }
  497. if let Some(ref v) = self.device_state.as_ref() {
  498. let len = v.compute_size();
  499. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  500. }
  501. if let Some(ref v) = self.goodbye.as_ref() {
  502. let len = v.compute_size();
  503. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  504. }
  505. if let Some(ref v) = self.state.as_ref() {
  506. let len = v.compute_size();
  507. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  508. }
  509. if let Some(v) = self.position {
  510. my_size += ::protobuf::rt::value_size(13, v, ::protobuf::wire_format::WireTypeVarint);
  511. }
  512. if let Some(v) = self.volume {
  513. my_size += ::protobuf::rt::value_size(14, v, ::protobuf::wire_format::WireTypeVarint);
  514. }
  515. if let Some(v) = self.state_update_id {
  516. my_size += ::protobuf::rt::value_size(17, v, ::protobuf::wire_format::WireTypeVarint);
  517. }
  518. for value in &self.recipient {
  519. my_size += ::protobuf::rt::string_size(18, &value);
  520. };
  521. if let Some(ref v) = self.context_player_state.as_ref() {
  522. my_size += ::protobuf::rt::bytes_size(19, &v);
  523. }
  524. if let Some(ref v) = self.new_name.as_ref() {
  525. my_size += ::protobuf::rt::string_size(20, &v);
  526. }
  527. if let Some(ref v) = self.metadata.as_ref() {
  528. let len = v.compute_size();
  529. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  530. }
  531. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  532. self.cached_size.set(my_size);
  533. my_size
  534. }
  535. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  536. if let Some(v) = self.version {
  537. os.write_uint32(1, v)?;
  538. }
  539. if let Some(ref v) = self.ident.as_ref() {
  540. os.write_string(2, &v)?;
  541. }
  542. if let Some(ref v) = self.protocol_version.as_ref() {
  543. os.write_string(3, &v)?;
  544. }
  545. if let Some(v) = self.seq_nr {
  546. os.write_uint32(4, v)?;
  547. }
  548. if let Some(v) = self.typ {
  549. os.write_enum(5, v.value())?;
  550. }
  551. if let Some(ref v) = self.device_state.as_ref() {
  552. os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  553. os.write_raw_varint32(v.get_cached_size())?;
  554. v.write_to_with_cached_sizes(os)?;
  555. }
  556. if let Some(ref v) = self.goodbye.as_ref() {
  557. os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  558. os.write_raw_varint32(v.get_cached_size())?;
  559. v.write_to_with_cached_sizes(os)?;
  560. }
  561. if let Some(ref v) = self.state.as_ref() {
  562. os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  563. os.write_raw_varint32(v.get_cached_size())?;
  564. v.write_to_with_cached_sizes(os)?;
  565. }
  566. if let Some(v) = self.position {
  567. os.write_uint32(13, v)?;
  568. }
  569. if let Some(v) = self.volume {
  570. os.write_uint32(14, v)?;
  571. }
  572. if let Some(v) = self.state_update_id {
  573. os.write_int64(17, v)?;
  574. }
  575. for v in &self.recipient {
  576. os.write_string(18, &v)?;
  577. };
  578. if let Some(ref v) = self.context_player_state.as_ref() {
  579. os.write_bytes(19, &v)?;
  580. }
  581. if let Some(ref v) = self.new_name.as_ref() {
  582. os.write_string(20, &v)?;
  583. }
  584. if let Some(ref v) = self.metadata.as_ref() {
  585. os.write_tag(25, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  586. os.write_raw_varint32(v.get_cached_size())?;
  587. v.write_to_with_cached_sizes(os)?;
  588. }
  589. os.write_unknown_fields(self.get_unknown_fields())?;
  590. ::std::result::Result::Ok(())
  591. }
  592. fn get_cached_size(&self) -> u32 {
  593. self.cached_size.get()
  594. }
  595. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  596. &self.unknown_fields
  597. }
  598. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  599. &mut self.unknown_fields
  600. }
  601. fn as_any(&self) -> &dyn (::std::any::Any) {
  602. self as &dyn (::std::any::Any)
  603. }
  604. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  605. self as &mut dyn (::std::any::Any)
  606. }
  607. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  608. self
  609. }
  610. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  611. Self::descriptor_static()
  612. }
  613. fn new() -> Frame {
  614. Frame::new()
  615. }
  616. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  617. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  618. lock: ::protobuf::lazy::ONCE_INIT,
  619. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  620. };
  621. unsafe {
  622. descriptor.get(|| {
  623. let mut fields = ::std::vec::Vec::new();
  624. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
  625. "version",
  626. |m: &Frame| { &m.version },
  627. |m: &mut Frame| { &mut m.version },
  628. ));
  629. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  630. "ident",
  631. |m: &Frame| { &m.ident },
  632. |m: &mut Frame| { &mut m.ident },
  633. ));
  634. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  635. "protocol_version",
  636. |m: &Frame| { &m.protocol_version },
  637. |m: &mut Frame| { &mut m.protocol_version },
  638. ));
  639. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
  640. "seq_nr",
  641. |m: &Frame| { &m.seq_nr },
  642. |m: &mut Frame| { &mut m.seq_nr },
  643. ));
  644. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum<MessageType>>(
  645. "typ",
  646. |m: &Frame| { &m.typ },
  647. |m: &mut Frame| { &mut m.typ },
  648. ));
  649. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<DeviceState>>(
  650. "device_state",
  651. |m: &Frame| { &m.device_state },
  652. |m: &mut Frame| { &mut m.device_state },
  653. ));
  654. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Goodbye>>(
  655. "goodbye",
  656. |m: &Frame| { &m.goodbye },
  657. |m: &mut Frame| { &mut m.goodbye },
  658. ));
  659. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<State>>(
  660. "state",
  661. |m: &Frame| { &m.state },
  662. |m: &mut Frame| { &mut m.state },
  663. ));
  664. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
  665. "position",
  666. |m: &Frame| { &m.position },
  667. |m: &mut Frame| { &mut m.position },
  668. ));
  669. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
  670. "volume",
  671. |m: &Frame| { &m.volume },
  672. |m: &mut Frame| { &mut m.volume },
  673. ));
  674. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
  675. "state_update_id",
  676. |m: &Frame| { &m.state_update_id },
  677. |m: &mut Frame| { &mut m.state_update_id },
  678. ));
  679. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  680. "recipient",
  681. |m: &Frame| { &m.recipient },
  682. |m: &mut Frame| { &mut m.recipient },
  683. ));
  684. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  685. "context_player_state",
  686. |m: &Frame| { &m.context_player_state },
  687. |m: &mut Frame| { &mut m.context_player_state },
  688. ));
  689. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  690. "new_name",
  691. |m: &Frame| { &m.new_name },
  692. |m: &mut Frame| { &mut m.new_name },
  693. ));
  694. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Metadata>>(
  695. "metadata",
  696. |m: &Frame| { &m.metadata },
  697. |m: &mut Frame| { &mut m.metadata },
  698. ));
  699. ::protobuf::reflect::MessageDescriptor::new::<Frame>(
  700. "Frame",
  701. fields,
  702. file_descriptor_proto()
  703. )
  704. })
  705. }
  706. }
  707. fn default_instance() -> &'static Frame {
  708. static mut instance: ::protobuf::lazy::Lazy<Frame> = ::protobuf::lazy::Lazy {
  709. lock: ::protobuf::lazy::ONCE_INIT,
  710. ptr: 0 as *const Frame,
  711. };
  712. unsafe {
  713. instance.get(Frame::new)
  714. }
  715. }
  716. }
  717. impl ::protobuf::Clear for Frame {
  718. fn clear(&mut self) {
  719. self.version = ::std::option::Option::None;
  720. self.ident.clear();
  721. self.protocol_version.clear();
  722. self.seq_nr = ::std::option::Option::None;
  723. self.typ = ::std::option::Option::None;
  724. self.device_state.clear();
  725. self.goodbye.clear();
  726. self.state.clear();
  727. self.position = ::std::option::Option::None;
  728. self.volume = ::std::option::Option::None;
  729. self.state_update_id = ::std::option::Option::None;
  730. self.recipient.clear();
  731. self.context_player_state.clear();
  732. self.new_name.clear();
  733. self.metadata.clear();
  734. self.unknown_fields.clear();
  735. }
  736. }
  737. impl ::std::fmt::Debug for Frame {
  738. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  739. ::protobuf::text_format::fmt(self, f)
  740. }
  741. }
  742. impl ::protobuf::reflect::ProtobufValue for Frame {
  743. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  744. ::protobuf::reflect::ProtobufValueRef::Message(self)
  745. }
  746. }
  747. #[derive(PartialEq,Clone,Default)]
  748. pub struct DeviceState {
  749. // message fields
  750. sw_version: ::protobuf::SingularField<::std::string::String>,
  751. is_active: ::std::option::Option<bool>,
  752. can_play: ::std::option::Option<bool>,
  753. volume: ::std::option::Option<u32>,
  754. name: ::protobuf::SingularField<::std::string::String>,
  755. error_code: ::std::option::Option<u32>,
  756. became_active_at: ::std::option::Option<i64>,
  757. error_message: ::protobuf::SingularField<::std::string::String>,
  758. capabilities: ::protobuf::RepeatedField<Capability>,
  759. context_player_error: ::protobuf::SingularField<::std::string::String>,
  760. metadata: ::protobuf::RepeatedField<Metadata>,
  761. // special fields
  762. pub unknown_fields: ::protobuf::UnknownFields,
  763. pub cached_size: ::protobuf::CachedSize,
  764. }
  765. impl<'a> ::std::default::Default for &'a DeviceState {
  766. fn default() -> &'a DeviceState {
  767. <DeviceState as ::protobuf::Message>::default_instance()
  768. }
  769. }
  770. impl DeviceState {
  771. pub fn new() -> DeviceState {
  772. ::std::default::Default::default()
  773. }
  774. // optional string sw_version = 1;
  775. pub fn get_sw_version(&self) -> &str {
  776. match self.sw_version.as_ref() {
  777. Some(v) => &v,
  778. None => "",
  779. }
  780. }
  781. pub fn clear_sw_version(&mut self) {
  782. self.sw_version.clear();
  783. }
  784. pub fn has_sw_version(&self) -> bool {
  785. self.sw_version.is_some()
  786. }
  787. // Param is passed by value, moved
  788. pub fn set_sw_version(&mut self, v: ::std::string::String) {
  789. self.sw_version = ::protobuf::SingularField::some(v);
  790. }
  791. // Mutable pointer to the field.
  792. // If field is not initialized, it is initialized with default value first.
  793. pub fn mut_sw_version(&mut self) -> &mut ::std::string::String {
  794. if self.sw_version.is_none() {
  795. self.sw_version.set_default();
  796. }
  797. self.sw_version.as_mut().unwrap()
  798. }
  799. // Take field
  800. pub fn take_sw_version(&mut self) -> ::std::string::String {
  801. self.sw_version.take().unwrap_or_else(|| ::std::string::String::new())
  802. }
  803. // optional bool is_active = 10;
  804. pub fn get_is_active(&self) -> bool {
  805. self.is_active.unwrap_or(false)
  806. }
  807. pub fn clear_is_active(&mut self) {
  808. self.is_active = ::std::option::Option::None;
  809. }
  810. pub fn has_is_active(&self) -> bool {
  811. self.is_active.is_some()
  812. }
  813. // Param is passed by value, moved
  814. pub fn set_is_active(&mut self, v: bool) {
  815. self.is_active = ::std::option::Option::Some(v);
  816. }
  817. // optional bool can_play = 11;
  818. pub fn get_can_play(&self) -> bool {
  819. self.can_play.unwrap_or(false)
  820. }
  821. pub fn clear_can_play(&mut self) {
  822. self.can_play = ::std::option::Option::None;
  823. }
  824. pub fn has_can_play(&self) -> bool {
  825. self.can_play.is_some()
  826. }
  827. // Param is passed by value, moved
  828. pub fn set_can_play(&mut self, v: bool) {
  829. self.can_play = ::std::option::Option::Some(v);
  830. }
  831. // optional uint32 volume = 12;
  832. pub fn get_volume(&self) -> u32 {
  833. self.volume.unwrap_or(0)
  834. }
  835. pub fn clear_volume(&mut self) {
  836. self.volume = ::std::option::Option::None;
  837. }
  838. pub fn has_volume(&self) -> bool {
  839. self.volume.is_some()
  840. }
  841. // Param is passed by value, moved
  842. pub fn set_volume(&mut self, v: u32) {
  843. self.volume = ::std::option::Option::Some(v);
  844. }
  845. // optional string name = 13;
  846. pub fn get_name(&self) -> &str {
  847. match self.name.as_ref() {
  848. Some(v) => &v,
  849. None => "",
  850. }
  851. }
  852. pub fn clear_name(&mut self) {
  853. self.name.clear();
  854. }
  855. pub fn has_name(&self) -> bool {
  856. self.name.is_some()
  857. }
  858. // Param is passed by value, moved
  859. pub fn set_name(&mut self, v: ::std::string::String) {
  860. self.name = ::protobuf::SingularField::some(v);
  861. }
  862. // Mutable pointer to the field.
  863. // If field is not initialized, it is initialized with default value first.
  864. pub fn mut_name(&mut self) -> &mut ::std::string::String {
  865. if self.name.is_none() {
  866. self.name.set_default();
  867. }
  868. self.name.as_mut().unwrap()
  869. }
  870. // Take field
  871. pub fn take_name(&mut self) -> ::std::string::String {
  872. self.name.take().unwrap_or_else(|| ::std::string::String::new())
  873. }
  874. // optional uint32 error_code = 14;
  875. pub fn get_error_code(&self) -> u32 {
  876. self.error_code.unwrap_or(0)
  877. }
  878. pub fn clear_error_code(&mut self) {
  879. self.error_code = ::std::option::Option::None;
  880. }
  881. pub fn has_error_code(&self) -> bool {
  882. self.error_code.is_some()
  883. }
  884. // Param is passed by value, moved
  885. pub fn set_error_code(&mut self, v: u32) {
  886. self.error_code = ::std::option::Option::Some(v);
  887. }
  888. // optional int64 became_active_at = 15;
  889. pub fn get_became_active_at(&self) -> i64 {
  890. self.became_active_at.unwrap_or(0)
  891. }
  892. pub fn clear_became_active_at(&mut self) {
  893. self.became_active_at = ::std::option::Option::None;
  894. }
  895. pub fn has_became_active_at(&self) -> bool {
  896. self.became_active_at.is_some()
  897. }
  898. // Param is passed by value, moved
  899. pub fn set_became_active_at(&mut self, v: i64) {
  900. self.became_active_at = ::std::option::Option::Some(v);
  901. }
  902. // optional string error_message = 16;
  903. pub fn get_error_message(&self) -> &str {
  904. match self.error_message.as_ref() {
  905. Some(v) => &v,
  906. None => "",
  907. }
  908. }
  909. pub fn clear_error_message(&mut self) {
  910. self.error_message.clear();
  911. }
  912. pub fn has_error_message(&self) -> bool {
  913. self.error_message.is_some()
  914. }
  915. // Param is passed by value, moved
  916. pub fn set_error_message(&mut self, v: ::std::string::String) {
  917. self.error_message = ::protobuf::SingularField::some(v);
  918. }
  919. // Mutable pointer to the field.
  920. // If field is not initialized, it is initialized with default value first.
  921. pub fn mut_error_message(&mut self) -> &mut ::std::string::String {
  922. if self.error_message.is_none() {
  923. self.error_message.set_default();
  924. }
  925. self.error_message.as_mut().unwrap()
  926. }
  927. // Take field
  928. pub fn take_error_message(&mut self) -> ::std::string::String {
  929. self.error_message.take().unwrap_or_else(|| ::std::string::String::new())
  930. }
  931. // repeated .Capability capabilities = 17;
  932. pub fn get_capabilities(&self) -> &[Capability] {
  933. &self.capabilities
  934. }
  935. pub fn clear_capabilities(&mut self) {
  936. self.capabilities.clear();
  937. }
  938. // Param is passed by value, moved
  939. pub fn set_capabilities(&mut self, v: ::protobuf::RepeatedField<Capability>) {
  940. self.capabilities = v;
  941. }
  942. // Mutable pointer to the field.
  943. pub fn mut_capabilities(&mut self) -> &mut ::protobuf::RepeatedField<Capability> {
  944. &mut self.capabilities
  945. }
  946. // Take field
  947. pub fn take_capabilities(&mut self) -> ::protobuf::RepeatedField<Capability> {
  948. ::std::mem::replace(&mut self.capabilities, ::protobuf::RepeatedField::new())
  949. }
  950. // optional string context_player_error = 20;
  951. pub fn get_context_player_error(&self) -> &str {
  952. match self.context_player_error.as_ref() {
  953. Some(v) => &v,
  954. None => "",
  955. }
  956. }
  957. pub fn clear_context_player_error(&mut self) {
  958. self.context_player_error.clear();
  959. }
  960. pub fn has_context_player_error(&self) -> bool {
  961. self.context_player_error.is_some()
  962. }
  963. // Param is passed by value, moved
  964. pub fn set_context_player_error(&mut self, v: ::std::string::String) {
  965. self.context_player_error = ::protobuf::SingularField::some(v);
  966. }
  967. // Mutable pointer to the field.
  968. // If field is not initialized, it is initialized with default value first.
  969. pub fn mut_context_player_error(&mut self) -> &mut ::std::string::String {
  970. if self.context_player_error.is_none() {
  971. self.context_player_error.set_default();
  972. }
  973. self.context_player_error.as_mut().unwrap()
  974. }
  975. // Take field
  976. pub fn take_context_player_error(&mut self) -> ::std::string::String {
  977. self.context_player_error.take().unwrap_or_else(|| ::std::string::String::new())
  978. }
  979. // repeated .Metadata metadata = 25;
  980. pub fn get_metadata(&self) -> &[Metadata] {
  981. &self.metadata
  982. }
  983. pub fn clear_metadata(&mut self) {
  984. self.metadata.clear();
  985. }
  986. // Param is passed by value, moved
  987. pub fn set_metadata(&mut self, v: ::protobuf::RepeatedField<Metadata>) {
  988. self.metadata = v;
  989. }
  990. // Mutable pointer to the field.
  991. pub fn mut_metadata(&mut self) -> &mut ::protobuf::RepeatedField<Metadata> {
  992. &mut self.metadata
  993. }
  994. // Take field
  995. pub fn take_metadata(&mut self) -> ::protobuf::RepeatedField<Metadata> {
  996. ::std::mem::replace(&mut self.metadata, ::protobuf::RepeatedField::new())
  997. }
  998. }
  999. impl ::protobuf::Message for DeviceState {
  1000. fn is_initialized(&self) -> bool {
  1001. for v in &self.capabilities {
  1002. if !v.is_initialized() {
  1003. return false;
  1004. }
  1005. };
  1006. for v in &self.metadata {
  1007. if !v.is_initialized() {
  1008. return false;
  1009. }
  1010. };
  1011. true
  1012. }
  1013. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1014. while !is.eof()? {
  1015. let (field_number, wire_type) = is.read_tag_unpack()?;
  1016. match field_number {
  1017. 1 => {
  1018. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.sw_version)?;
  1019. },
  1020. 10 => {
  1021. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1022. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1023. }
  1024. let tmp = is.read_bool()?;
  1025. self.is_active = ::std::option::Option::Some(tmp);
  1026. },
  1027. 11 => {
  1028. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1029. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1030. }
  1031. let tmp = is.read_bool()?;
  1032. self.can_play = ::std::option::Option::Some(tmp);
  1033. },
  1034. 12 => {
  1035. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1036. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1037. }
  1038. let tmp = is.read_uint32()?;
  1039. self.volume = ::std::option::Option::Some(tmp);
  1040. },
  1041. 13 => {
  1042. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)?;
  1043. },
  1044. 14 => {
  1045. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1046. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1047. }
  1048. let tmp = is.read_uint32()?;
  1049. self.error_code = ::std::option::Option::Some(tmp);
  1050. },
  1051. 15 => {
  1052. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1053. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1054. }
  1055. let tmp = is.read_int64()?;
  1056. self.became_active_at = ::std::option::Option::Some(tmp);
  1057. },
  1058. 16 => {
  1059. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.error_message)?;
  1060. },
  1061. 17 => {
  1062. ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.capabilities)?;
  1063. },
  1064. 20 => {
  1065. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.context_player_error)?;
  1066. },
  1067. 25 => {
  1068. ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.metadata)?;
  1069. },
  1070. _ => {
  1071. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1072. },
  1073. };
  1074. }
  1075. ::std::result::Result::Ok(())
  1076. }
  1077. // Compute sizes of nested messages
  1078. #[allow(unused_variables)]
  1079. fn compute_size(&self) -> u32 {
  1080. let mut my_size = 0;
  1081. if let Some(ref v) = self.sw_version.as_ref() {
  1082. my_size += ::protobuf::rt::string_size(1, &v);
  1083. }
  1084. if let Some(v) = self.is_active {
  1085. my_size += 2;
  1086. }
  1087. if let Some(v) = self.can_play {
  1088. my_size += 2;
  1089. }
  1090. if let Some(v) = self.volume {
  1091. my_size += ::protobuf::rt::value_size(12, v, ::protobuf::wire_format::WireTypeVarint);
  1092. }
  1093. if let Some(ref v) = self.name.as_ref() {
  1094. my_size += ::protobuf::rt::string_size(13, &v);
  1095. }
  1096. if let Some(v) = self.error_code {
  1097. my_size += ::protobuf::rt::value_size(14, v, ::protobuf::wire_format::WireTypeVarint);
  1098. }
  1099. if let Some(v) = self.became_active_at {
  1100. my_size += ::protobuf::rt::value_size(15, v, ::protobuf::wire_format::WireTypeVarint);
  1101. }
  1102. if let Some(ref v) = self.error_message.as_ref() {
  1103. my_size += ::protobuf::rt::string_size(16, &v);
  1104. }
  1105. for value in &self.capabilities {
  1106. let len = value.compute_size();
  1107. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1108. };
  1109. if let Some(ref v) = self.context_player_error.as_ref() {
  1110. my_size += ::protobuf::rt::string_size(20, &v);
  1111. }
  1112. for value in &self.metadata {
  1113. let len = value.compute_size();
  1114. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1115. };
  1116. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1117. self.cached_size.set(my_size);
  1118. my_size
  1119. }
  1120. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1121. if let Some(ref v) = self.sw_version.as_ref() {
  1122. os.write_string(1, &v)?;
  1123. }
  1124. if let Some(v) = self.is_active {
  1125. os.write_bool(10, v)?;
  1126. }
  1127. if let Some(v) = self.can_play {
  1128. os.write_bool(11, v)?;
  1129. }
  1130. if let Some(v) = self.volume {
  1131. os.write_uint32(12, v)?;
  1132. }
  1133. if let Some(ref v) = self.name.as_ref() {
  1134. os.write_string(13, &v)?;
  1135. }
  1136. if let Some(v) = self.error_code {
  1137. os.write_uint32(14, v)?;
  1138. }
  1139. if let Some(v) = self.became_active_at {
  1140. os.write_int64(15, v)?;
  1141. }
  1142. if let Some(ref v) = self.error_message.as_ref() {
  1143. os.write_string(16, &v)?;
  1144. }
  1145. for v in &self.capabilities {
  1146. os.write_tag(17, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1147. os.write_raw_varint32(v.get_cached_size())?;
  1148. v.write_to_with_cached_sizes(os)?;
  1149. };
  1150. if let Some(ref v) = self.context_player_error.as_ref() {
  1151. os.write_string(20, &v)?;
  1152. }
  1153. for v in &self.metadata {
  1154. os.write_tag(25, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1155. os.write_raw_varint32(v.get_cached_size())?;
  1156. v.write_to_with_cached_sizes(os)?;
  1157. };
  1158. os.write_unknown_fields(self.get_unknown_fields())?;
  1159. ::std::result::Result::Ok(())
  1160. }
  1161. fn get_cached_size(&self) -> u32 {
  1162. self.cached_size.get()
  1163. }
  1164. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1165. &self.unknown_fields
  1166. }
  1167. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1168. &mut self.unknown_fields
  1169. }
  1170. fn as_any(&self) -> &dyn (::std::any::Any) {
  1171. self as &dyn (::std::any::Any)
  1172. }
  1173. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1174. self as &mut dyn (::std::any::Any)
  1175. }
  1176. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1177. self
  1178. }
  1179. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1180. Self::descriptor_static()
  1181. }
  1182. fn new() -> DeviceState {
  1183. DeviceState::new()
  1184. }
  1185. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1186. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  1187. lock: ::protobuf::lazy::ONCE_INIT,
  1188. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  1189. };
  1190. unsafe {
  1191. descriptor.get(|| {
  1192. let mut fields = ::std::vec::Vec::new();
  1193. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1194. "sw_version",
  1195. |m: &DeviceState| { &m.sw_version },
  1196. |m: &mut DeviceState| { &mut m.sw_version },
  1197. ));
  1198. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
  1199. "is_active",
  1200. |m: &DeviceState| { &m.is_active },
  1201. |m: &mut DeviceState| { &mut m.is_active },
  1202. ));
  1203. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
  1204. "can_play",
  1205. |m: &DeviceState| { &m.can_play },
  1206. |m: &mut DeviceState| { &mut m.can_play },
  1207. ));
  1208. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
  1209. "volume",
  1210. |m: &DeviceState| { &m.volume },
  1211. |m: &mut DeviceState| { &mut m.volume },
  1212. ));
  1213. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1214. "name",
  1215. |m: &DeviceState| { &m.name },
  1216. |m: &mut DeviceState| { &mut m.name },
  1217. ));
  1218. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
  1219. "error_code",
  1220. |m: &DeviceState| { &m.error_code },
  1221. |m: &mut DeviceState| { &mut m.error_code },
  1222. ));
  1223. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
  1224. "became_active_at",
  1225. |m: &DeviceState| { &m.became_active_at },
  1226. |m: &mut DeviceState| { &mut m.became_active_at },
  1227. ));
  1228. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1229. "error_message",
  1230. |m: &DeviceState| { &m.error_message },
  1231. |m: &mut DeviceState| { &mut m.error_message },
  1232. ));
  1233. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Capability>>(
  1234. "capabilities",
  1235. |m: &DeviceState| { &m.capabilities },
  1236. |m: &mut DeviceState| { &mut m.capabilities },
  1237. ));
  1238. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1239. "context_player_error",
  1240. |m: &DeviceState| { &m.context_player_error },
  1241. |m: &mut DeviceState| { &mut m.context_player_error },
  1242. ));
  1243. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Metadata>>(
  1244. "metadata",
  1245. |m: &DeviceState| { &m.metadata },
  1246. |m: &mut DeviceState| { &mut m.metadata },
  1247. ));
  1248. ::protobuf::reflect::MessageDescriptor::new::<DeviceState>(
  1249. "DeviceState",
  1250. fields,
  1251. file_descriptor_proto()
  1252. )
  1253. })
  1254. }
  1255. }
  1256. fn default_instance() -> &'static DeviceState {
  1257. static mut instance: ::protobuf::lazy::Lazy<DeviceState> = ::protobuf::lazy::Lazy {
  1258. lock: ::protobuf::lazy::ONCE_INIT,
  1259. ptr: 0 as *const DeviceState,
  1260. };
  1261. unsafe {
  1262. instance.get(DeviceState::new)
  1263. }
  1264. }
  1265. }
  1266. impl ::protobuf::Clear for DeviceState {
  1267. fn clear(&mut self) {
  1268. self.sw_version.clear();
  1269. self.is_active = ::std::option::Option::None;
  1270. self.can_play = ::std::option::Option::None;
  1271. self.volume = ::std::option::Option::None;
  1272. self.name.clear();
  1273. self.error_code = ::std::option::Option::None;
  1274. self.became_active_at = ::std::option::Option::None;
  1275. self.error_message.clear();
  1276. self.capabilities.clear();
  1277. self.context_player_error.clear();
  1278. self.metadata.clear();
  1279. self.unknown_fields.clear();
  1280. }
  1281. }
  1282. impl ::std::fmt::Debug for DeviceState {
  1283. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1284. ::protobuf::text_format::fmt(self, f)
  1285. }
  1286. }
  1287. impl ::protobuf::reflect::ProtobufValue for DeviceState {
  1288. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  1289. ::protobuf::reflect::ProtobufValueRef::Message(self)
  1290. }
  1291. }
  1292. #[derive(PartialEq,Clone,Default)]
  1293. pub struct Capability {
  1294. // message fields
  1295. typ: ::std::option::Option<CapabilityType>,
  1296. intValue: ::std::vec::Vec<i64>,
  1297. stringValue: ::protobuf::RepeatedField<::std::string::String>,
  1298. // special fields
  1299. pub unknown_fields: ::protobuf::UnknownFields,
  1300. pub cached_size: ::protobuf::CachedSize,
  1301. }
  1302. impl<'a> ::std::default::Default for &'a Capability {
  1303. fn default() -> &'a Capability {
  1304. <Capability as ::protobuf::Message>::default_instance()
  1305. }
  1306. }
  1307. impl Capability {
  1308. pub fn new() -> Capability {
  1309. ::std::default::Default::default()
  1310. }
  1311. // optional .CapabilityType typ = 1;
  1312. pub fn get_typ(&self) -> CapabilityType {
  1313. self.typ.unwrap_or(CapabilityType::kSupportedContexts)
  1314. }
  1315. pub fn clear_typ(&mut self) {
  1316. self.typ = ::std::option::Option::None;
  1317. }
  1318. pub fn has_typ(&self) -> bool {
  1319. self.typ.is_some()
  1320. }
  1321. // Param is passed by value, moved
  1322. pub fn set_typ(&mut self, v: CapabilityType) {
  1323. self.typ = ::std::option::Option::Some(v);
  1324. }
  1325. // repeated int64 intValue = 2;
  1326. pub fn get_intValue(&self) -> &[i64] {
  1327. &self.intValue
  1328. }
  1329. pub fn clear_intValue(&mut self) {
  1330. self.intValue.clear();
  1331. }
  1332. // Param is passed by value, moved
  1333. pub fn set_intValue(&mut self, v: ::std::vec::Vec<i64>) {
  1334. self.intValue = v;
  1335. }
  1336. // Mutable pointer to the field.
  1337. pub fn mut_intValue(&mut self) -> &mut ::std::vec::Vec<i64> {
  1338. &mut self.intValue
  1339. }
  1340. // Take field
  1341. pub fn take_intValue(&mut self) -> ::std::vec::Vec<i64> {
  1342. ::std::mem::replace(&mut self.intValue, ::std::vec::Vec::new())
  1343. }
  1344. // repeated string stringValue = 3;
  1345. pub fn get_stringValue(&self) -> &[::std::string::String] {
  1346. &self.stringValue
  1347. }
  1348. pub fn clear_stringValue(&mut self) {
  1349. self.stringValue.clear();
  1350. }
  1351. // Param is passed by value, moved
  1352. pub fn set_stringValue(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
  1353. self.stringValue = v;
  1354. }
  1355. // Mutable pointer to the field.
  1356. pub fn mut_stringValue(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
  1357. &mut self.stringValue
  1358. }
  1359. // Take field
  1360. pub fn take_stringValue(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
  1361. ::std::mem::replace(&mut self.stringValue, ::protobuf::RepeatedField::new())
  1362. }
  1363. }
  1364. impl ::protobuf::Message for Capability {
  1365. fn is_initialized(&self) -> bool {
  1366. true
  1367. }
  1368. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1369. while !is.eof()? {
  1370. let (field_number, wire_type) = is.read_tag_unpack()?;
  1371. match field_number {
  1372. 1 => {
  1373. ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.typ, 1, &mut self.unknown_fields)?
  1374. },
  1375. 2 => {
  1376. ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.intValue)?;
  1377. },
  1378. 3 => {
  1379. ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.stringValue)?;
  1380. },
  1381. _ => {
  1382. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1383. },
  1384. };
  1385. }
  1386. ::std::result::Result::Ok(())
  1387. }
  1388. // Compute sizes of nested messages
  1389. #[allow(unused_variables)]
  1390. fn compute_size(&self) -> u32 {
  1391. let mut my_size = 0;
  1392. if let Some(v) = self.typ {
  1393. my_size += ::protobuf::rt::enum_size(1, v);
  1394. }
  1395. for value in &self.intValue {
  1396. my_size += ::protobuf::rt::value_size(2, *value, ::protobuf::wire_format::WireTypeVarint);
  1397. };
  1398. for value in &self.stringValue {
  1399. my_size += ::protobuf::rt::string_size(3, &value);
  1400. };
  1401. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1402. self.cached_size.set(my_size);
  1403. my_size
  1404. }
  1405. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1406. if let Some(v) = self.typ {
  1407. os.write_enum(1, v.value())?;
  1408. }
  1409. for v in &self.intValue {
  1410. os.write_int64(2, *v)?;
  1411. };
  1412. for v in &self.stringValue {
  1413. os.write_string(3, &v)?;
  1414. };
  1415. os.write_unknown_fields(self.get_unknown_fields())?;
  1416. ::std::result::Result::Ok(())
  1417. }
  1418. fn get_cached_size(&self) -> u32 {
  1419. self.cached_size.get()
  1420. }
  1421. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1422. &self.unknown_fields
  1423. }
  1424. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1425. &mut self.unknown_fields
  1426. }
  1427. fn as_any(&self) -> &dyn (::std::any::Any) {
  1428. self as &dyn (::std::any::Any)
  1429. }
  1430. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1431. self as &mut dyn (::std::any::Any)
  1432. }
  1433. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1434. self
  1435. }
  1436. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1437. Self::descriptor_static()
  1438. }
  1439. fn new() -> Capability {
  1440. Capability::new()
  1441. }
  1442. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1443. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  1444. lock: ::protobuf::lazy::ONCE_INIT,
  1445. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  1446. };
  1447. unsafe {
  1448. descriptor.get(|| {
  1449. let mut fields = ::std::vec::Vec::new();
  1450. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum<CapabilityType>>(
  1451. "typ",
  1452. |m: &Capability| { &m.typ },
  1453. |m: &mut Capability| { &mut m.typ },
  1454. ));
  1455. fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
  1456. "intValue",
  1457. |m: &Capability| { &m.intValue },
  1458. |m: &mut Capability| { &mut m.intValue },
  1459. ));
  1460. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1461. "stringValue",
  1462. |m: &Capability| { &m.stringValue },
  1463. |m: &mut Capability| { &mut m.stringValue },
  1464. ));
  1465. ::protobuf::reflect::MessageDescriptor::new::<Capability>(
  1466. "Capability",
  1467. fields,
  1468. file_descriptor_proto()
  1469. )
  1470. })
  1471. }
  1472. }
  1473. fn default_instance() -> &'static Capability {
  1474. static mut instance: ::protobuf::lazy::Lazy<Capability> = ::protobuf::lazy::Lazy {
  1475. lock: ::protobuf::lazy::ONCE_INIT,
  1476. ptr: 0 as *const Capability,
  1477. };
  1478. unsafe {
  1479. instance.get(Capability::new)
  1480. }
  1481. }
  1482. }
  1483. impl ::protobuf::Clear for Capability {
  1484. fn clear(&mut self) {
  1485. self.typ = ::std::option::Option::None;
  1486. self.intValue.clear();
  1487. self.stringValue.clear();
  1488. self.unknown_fields.clear();
  1489. }
  1490. }
  1491. impl ::std::fmt::Debug for Capability {
  1492. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1493. ::protobuf::text_format::fmt(self, f)
  1494. }
  1495. }
  1496. impl ::protobuf::reflect::ProtobufValue for Capability {
  1497. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  1498. ::protobuf::reflect::ProtobufValueRef::Message(self)
  1499. }
  1500. }
  1501. #[derive(PartialEq,Clone,Default)]
  1502. pub struct Goodbye {
  1503. // message fields
  1504. reason: ::protobuf::SingularField<::std::string::String>,
  1505. // special fields
  1506. pub unknown_fields: ::protobuf::UnknownFields,
  1507. pub cached_size: ::protobuf::CachedSize,
  1508. }
  1509. impl<'a> ::std::default::Default for &'a Goodbye {
  1510. fn default() -> &'a Goodbye {
  1511. <Goodbye as ::protobuf::Message>::default_instance()
  1512. }
  1513. }
  1514. impl Goodbye {
  1515. pub fn new() -> Goodbye {
  1516. ::std::default::Default::default()
  1517. }
  1518. // optional string reason = 1;
  1519. pub fn get_reason(&self) -> &str {
  1520. match self.reason.as_ref() {
  1521. Some(v) => &v,
  1522. None => "",
  1523. }
  1524. }
  1525. pub fn clear_reason(&mut self) {
  1526. self.reason.clear();
  1527. }
  1528. pub fn has_reason(&self) -> bool {
  1529. self.reason.is_some()
  1530. }
  1531. // Param is passed by value, moved
  1532. pub fn set_reason(&mut self, v: ::std::string::String) {
  1533. self.reason = ::protobuf::SingularField::some(v);
  1534. }
  1535. // Mutable pointer to the field.
  1536. // If field is not initialized, it is initialized with default value first.
  1537. pub fn mut_reason(&mut self) -> &mut ::std::string::String {
  1538. if self.reason.is_none() {
  1539. self.reason.set_default();
  1540. }
  1541. self.reason.as_mut().unwrap()
  1542. }
  1543. // Take field
  1544. pub fn take_reason(&mut self) -> ::std::string::String {
  1545. self.reason.take().unwrap_or_else(|| ::std::string::String::new())
  1546. }
  1547. }
  1548. impl ::protobuf::Message for Goodbye {
  1549. fn is_initialized(&self) -> bool {
  1550. true
  1551. }
  1552. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1553. while !is.eof()? {
  1554. let (field_number, wire_type) = is.read_tag_unpack()?;
  1555. match field_number {
  1556. 1 => {
  1557. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.reason)?;
  1558. },
  1559. _ => {
  1560. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1561. },
  1562. };
  1563. }
  1564. ::std::result::Result::Ok(())
  1565. }
  1566. // Compute sizes of nested messages
  1567. #[allow(unused_variables)]
  1568. fn compute_size(&self) -> u32 {
  1569. let mut my_size = 0;
  1570. if let Some(ref v) = self.reason.as_ref() {
  1571. my_size += ::protobuf::rt::string_size(1, &v);
  1572. }
  1573. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1574. self.cached_size.set(my_size);
  1575. my_size
  1576. }
  1577. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1578. if let Some(ref v) = self.reason.as_ref() {
  1579. os.write_string(1, &v)?;
  1580. }
  1581. os.write_unknown_fields(self.get_unknown_fields())?;
  1582. ::std::result::Result::Ok(())
  1583. }
  1584. fn get_cached_size(&self) -> u32 {
  1585. self.cached_size.get()
  1586. }
  1587. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1588. &self.unknown_fields
  1589. }
  1590. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1591. &mut self.unknown_fields
  1592. }
  1593. fn as_any(&self) -> &dyn (::std::any::Any) {
  1594. self as &dyn (::std::any::Any)
  1595. }
  1596. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  1597. self as &mut dyn (::std::any::Any)
  1598. }
  1599. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  1600. self
  1601. }
  1602. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1603. Self::descriptor_static()
  1604. }
  1605. fn new() -> Goodbye {
  1606. Goodbye::new()
  1607. }
  1608. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1609. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  1610. lock: ::protobuf::lazy::ONCE_INIT,
  1611. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  1612. };
  1613. unsafe {
  1614. descriptor.get(|| {
  1615. let mut fields = ::std::vec::Vec::new();
  1616. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1617. "reason",
  1618. |m: &Goodbye| { &m.reason },
  1619. |m: &mut Goodbye| { &mut m.reason },
  1620. ));
  1621. ::protobuf::reflect::MessageDescriptor::new::<Goodbye>(
  1622. "Goodbye",
  1623. fields,
  1624. file_descriptor_proto()
  1625. )
  1626. })
  1627. }
  1628. }
  1629. fn default_instance() -> &'static Goodbye {
  1630. static mut instance: ::protobuf::lazy::Lazy<Goodbye> = ::protobuf::lazy::Lazy {
  1631. lock: ::protobuf::lazy::ONCE_INIT,
  1632. ptr: 0 as *const Goodbye,
  1633. };
  1634. unsafe {
  1635. instance.get(Goodbye::new)
  1636. }
  1637. }
  1638. }
  1639. impl ::protobuf::Clear for Goodbye {
  1640. fn clear(&mut self) {
  1641. self.reason.clear();
  1642. self.unknown_fields.clear();
  1643. }
  1644. }
  1645. impl ::std::fmt::Debug for Goodbye {
  1646. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  1647. ::protobuf::text_format::fmt(self, f)
  1648. }
  1649. }
  1650. impl ::protobuf::reflect::ProtobufValue for Goodbye {
  1651. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  1652. ::protobuf::reflect::ProtobufValueRef::Message(self)
  1653. }
  1654. }
  1655. #[derive(PartialEq,Clone,Default)]
  1656. pub struct State {
  1657. // message fields
  1658. context_uri: ::protobuf::SingularField<::std::string::String>,
  1659. index: ::std::option::Option<u32>,
  1660. position_ms: ::std::option::Option<u32>,
  1661. status: ::std::option::Option<PlayStatus>,
  1662. position_measured_at: ::std::option::Option<u64>,
  1663. context_description: ::protobuf::SingularField<::std::string::String>,
  1664. shuffle: ::std::option::Option<bool>,
  1665. repeat: ::std::option::Option<bool>,
  1666. last_command_ident: ::protobuf::SingularField<::std::string::String>,
  1667. last_command_msgid: ::std::option::Option<u32>,
  1668. playing_from_fallback: ::std::option::Option<bool>,
  1669. row: ::std::option::Option<u32>,
  1670. playing_track_index: ::std::option::Option<u32>,
  1671. track: ::protobuf::RepeatedField<TrackRef>,
  1672. ad: ::protobuf::SingularPtrField<Ad>,
  1673. // special fields
  1674. pub unknown_fields: ::protobuf::UnknownFields,
  1675. pub cached_size: ::protobuf::CachedSize,
  1676. }
  1677. impl<'a> ::std::default::Default for &'a State {
  1678. fn default() -> &'a State {
  1679. <State as ::protobuf::Message>::default_instance()
  1680. }
  1681. }
  1682. impl State {
  1683. pub fn new() -> State {
  1684. ::std::default::Default::default()
  1685. }
  1686. // optional string context_uri = 2;
  1687. pub fn get_context_uri(&self) -> &str {
  1688. match self.context_uri.as_ref() {
  1689. Some(v) => &v,
  1690. None => "",
  1691. }
  1692. }
  1693. pub fn clear_context_uri(&mut self) {
  1694. self.context_uri.clear();
  1695. }
  1696. pub fn has_context_uri(&self) -> bool {
  1697. self.context_uri.is_some()
  1698. }
  1699. // Param is passed by value, moved
  1700. pub fn set_context_uri(&mut self, v: ::std::string::String) {
  1701. self.context_uri = ::protobuf::SingularField::some(v);
  1702. }
  1703. // Mutable pointer to the field.
  1704. // If field is not initialized, it is initialized with default value first.
  1705. pub fn mut_context_uri(&mut self) -> &mut ::std::string::String {
  1706. if self.context_uri.is_none() {
  1707. self.context_uri.set_default();
  1708. }
  1709. self.context_uri.as_mut().unwrap()
  1710. }
  1711. // Take field
  1712. pub fn take_context_uri(&mut self) -> ::std::string::String {
  1713. self.context_uri.take().unwrap_or_else(|| ::std::string::String::new())
  1714. }
  1715. // optional uint32 index = 3;
  1716. pub fn get_index(&self) -> u32 {
  1717. self.index.unwrap_or(0)
  1718. }
  1719. pub fn clear_index(&mut self) {
  1720. self.index = ::std::option::Option::None;
  1721. }
  1722. pub fn has_index(&self) -> bool {
  1723. self.index.is_some()
  1724. }
  1725. // Param is passed by value, moved
  1726. pub fn set_index(&mut self, v: u32) {
  1727. self.index = ::std::option::Option::Some(v);
  1728. }
  1729. // optional uint32 position_ms = 4;
  1730. pub fn get_position_ms(&self) -> u32 {
  1731. self.position_ms.unwrap_or(0)
  1732. }
  1733. pub fn clear_position_ms(&mut self) {
  1734. self.position_ms = ::std::option::Option::None;
  1735. }
  1736. pub fn has_position_ms(&self) -> bool {
  1737. self.position_ms.is_some()
  1738. }
  1739. // Param is passed by value, moved
  1740. pub fn set_position_ms(&mut self, v: u32) {
  1741. self.position_ms = ::std::option::Option::Some(v);
  1742. }
  1743. // optional .PlayStatus status = 5;
  1744. pub fn get_status(&self) -> PlayStatus {
  1745. self.status.unwrap_or(PlayStatus::kPlayStatusStop)
  1746. }
  1747. pub fn clear_status(&mut self) {
  1748. self.status = ::std::option::Option::None;
  1749. }
  1750. pub fn has_status(&self) -> bool {
  1751. self.status.is_some()
  1752. }
  1753. // Param is passed by value, moved
  1754. pub fn set_status(&mut self, v: PlayStatus) {
  1755. self.status = ::std::option::Option::Some(v);
  1756. }
  1757. // optional uint64 position_measured_at = 7;
  1758. pub fn get_position_measured_at(&self) -> u64 {
  1759. self.position_measured_at.unwrap_or(0)
  1760. }
  1761. pub fn clear_position_measured_at(&mut self) {
  1762. self.position_measured_at = ::std::option::Option::None;
  1763. }
  1764. pub fn has_position_measured_at(&self) -> bool {
  1765. self.position_measured_at.is_some()
  1766. }
  1767. // Param is passed by value, moved
  1768. pub fn set_position_measured_at(&mut self, v: u64) {
  1769. self.position_measured_at = ::std::option::Option::Some(v);
  1770. }
  1771. // optional string context_description = 8;
  1772. pub fn get_context_description(&self) -> &str {
  1773. match self.context_description.as_ref() {
  1774. Some(v) => &v,
  1775. None => "",
  1776. }
  1777. }
  1778. pub fn clear_context_description(&mut self) {
  1779. self.context_description.clear();
  1780. }
  1781. pub fn has_context_description(&self) -> bool {
  1782. self.context_description.is_some()
  1783. }
  1784. // Param is passed by value, moved
  1785. pub fn set_context_description(&mut self, v: ::std::string::String) {
  1786. self.context_description = ::protobuf::SingularField::some(v);
  1787. }
  1788. // Mutable pointer to the field.
  1789. // If field is not initialized, it is initialized with default value first.
  1790. pub fn mut_context_description(&mut self) -> &mut ::std::string::String {
  1791. if self.context_description.is_none() {
  1792. self.context_description.set_default();
  1793. }
  1794. self.context_description.as_mut().unwrap()
  1795. }
  1796. // Take field
  1797. pub fn take_context_description(&mut self) -> ::std::string::String {
  1798. self.context_description.take().unwrap_or_else(|| ::std::string::String::new())
  1799. }
  1800. // optional bool shuffle = 13;
  1801. pub fn get_shuffle(&self) -> bool {
  1802. self.shuffle.unwrap_or(false)
  1803. }
  1804. pub fn clear_shuffle(&mut self) {
  1805. self.shuffle = ::std::option::Option::None;
  1806. }
  1807. pub fn has_shuffle(&self) -> bool {
  1808. self.shuffle.is_some()
  1809. }
  1810. // Param is passed by value, moved
  1811. pub fn set_shuffle(&mut self, v: bool) {
  1812. self.shuffle = ::std::option::Option::Some(v);
  1813. }
  1814. // optional bool repeat = 14;
  1815. pub fn get_repeat(&self) -> bool {
  1816. self.repeat.unwrap_or(false)
  1817. }
  1818. pub fn clear_repeat(&mut self) {
  1819. self.repeat = ::std::option::Option::None;
  1820. }
  1821. pub fn has_repeat(&self) -> bool {
  1822. self.repeat.is_some()
  1823. }
  1824. // Param is passed by value, moved
  1825. pub fn set_repeat(&mut self, v: bool) {
  1826. self.repeat = ::std::option::Option::Some(v);
  1827. }
  1828. // optional string last_command_ident = 20;
  1829. pub fn get_last_command_ident(&self) -> &str {
  1830. match self.last_command_ident.as_ref() {
  1831. Some(v) => &v,
  1832. None => "",
  1833. }
  1834. }
  1835. pub fn clear_last_command_ident(&mut self) {
  1836. self.last_command_ident.clear();
  1837. }
  1838. pub fn has_last_command_ident(&self) -> bool {
  1839. self.last_command_ident.is_some()
  1840. }
  1841. // Param is passed by value, moved
  1842. pub fn set_last_command_ident(&mut self, v: ::std::string::String) {
  1843. self.last_command_ident = ::protobuf::SingularField::some(v);
  1844. }
  1845. // Mutable pointer to the field.
  1846. // If field is not initialized, it is initialized with default value first.
  1847. pub fn mut_last_command_ident(&mut self) -> &mut ::std::string::String {
  1848. if self.last_command_ident.is_none() {
  1849. self.last_command_ident.set_default();
  1850. }
  1851. self.last_command_ident.as_mut().unwrap()
  1852. }
  1853. // Take field
  1854. pub fn take_last_command_ident(&mut self) -> ::std::string::String {
  1855. self.last_command_ident.take().unwrap_or_else(|| ::std::string::String::new())
  1856. }
  1857. // optional uint32 last_command_msgid = 21;
  1858. pub fn get_last_command_msgid(&self) -> u32 {
  1859. self.last_command_msgid.unwrap_or(0)
  1860. }
  1861. pub fn clear_last_command_msgid(&mut self) {
  1862. self.last_command_msgid = ::std::option::Option::None;
  1863. }
  1864. pub fn has_last_command_msgid(&self) -> bool {
  1865. self.last_command_msgid.is_some()
  1866. }
  1867. // Param is passed by value, moved
  1868. pub fn set_last_command_msgid(&mut self, v: u32) {
  1869. self.last_command_msgid = ::std::option::Option::Some(v);
  1870. }
  1871. // optional bool playing_from_fallback = 24;
  1872. pub fn get_playing_from_fallback(&self) -> bool {
  1873. self.playing_from_fallback.unwrap_or(false)
  1874. }
  1875. pub fn clear_playing_from_fallback(&mut self) {
  1876. self.playing_from_fallback = ::std::option::Option::None;
  1877. }
  1878. pub fn has_playing_from_fallback(&self) -> bool {
  1879. self.playing_from_fallback.is_some()
  1880. }
  1881. // Param is passed by value, moved
  1882. pub fn set_playing_from_fallback(&mut self, v: bool) {
  1883. self.playing_from_fallback = ::std::option::Option::Some(v);
  1884. }
  1885. // optional uint32 row = 25;
  1886. pub fn get_row(&self) -> u32 {
  1887. self.row.unwrap_or(0)
  1888. }
  1889. pub fn clear_row(&mut self) {
  1890. self.row = ::std::option::Option::None;
  1891. }
  1892. pub fn has_row(&self) -> bool {
  1893. self.row.is_some()
  1894. }
  1895. // Param is passed by value, moved
  1896. pub fn set_row(&mut self, v: u32) {
  1897. self.row = ::std::option::Option::Some(v);
  1898. }
  1899. // optional uint32 playing_track_index = 26;
  1900. pub fn get_playing_track_index(&self) -> u32 {
  1901. self.playing_track_index.unwrap_or(0)
  1902. }
  1903. pub fn clear_playing_track_index(&mut self) {
  1904. self.playing_track_index = ::std::option::Option::None;
  1905. }
  1906. pub fn has_playing_track_index(&self) -> bool {
  1907. self.playing_track_index.is_some()
  1908. }
  1909. // Param is passed by value, moved
  1910. pub fn set_playing_track_index(&mut self, v: u32) {
  1911. self.playing_track_index = ::std::option::Option::Some(v);
  1912. }
  1913. // repeated .TrackRef track = 27;
  1914. pub fn get_track(&self) -> &[TrackRef] {
  1915. &self.track
  1916. }
  1917. pub fn clear_track(&mut self) {
  1918. self.track.clear();
  1919. }
  1920. // Param is passed by value, moved
  1921. pub fn set_track(&mut self, v: ::protobuf::RepeatedField<TrackRef>) {
  1922. self.track = v;
  1923. }
  1924. // Mutable pointer to the field.
  1925. pub fn mut_track(&mut self) -> &mut ::protobuf::RepeatedField<TrackRef> {
  1926. &mut self.track
  1927. }
  1928. // Take field
  1929. pub fn take_track(&mut self) -> ::protobuf::RepeatedField<TrackRef> {
  1930. ::std::mem::replace(&mut self.track, ::protobuf::RepeatedField::new())
  1931. }
  1932. // optional .Ad ad = 28;
  1933. pub fn get_ad(&self) -> &Ad {
  1934. self.ad.as_ref().unwrap_or_else(|| Ad::default_instance())
  1935. }
  1936. pub fn clear_ad(&mut self) {
  1937. self.ad.clear();
  1938. }
  1939. pub fn has_ad(&self) -> bool {
  1940. self.ad.is_some()
  1941. }
  1942. // Param is passed by value, moved
  1943. pub fn set_ad(&mut self, v: Ad) {
  1944. self.ad = ::protobuf::SingularPtrField::some(v);
  1945. }
  1946. // Mutable pointer to the field.
  1947. // If field is not initialized, it is initialized with default value first.
  1948. pub fn mut_ad(&mut self) -> &mut Ad {
  1949. if self.ad.is_none() {
  1950. self.ad.set_default();
  1951. }
  1952. self.ad.as_mut().unwrap()
  1953. }
  1954. // Take field
  1955. pub fn take_ad(&mut self) -> Ad {
  1956. self.ad.take().unwrap_or_else(|| Ad::new())
  1957. }
  1958. }
  1959. impl ::protobuf::Message for State {
  1960. fn is_initialized(&self) -> bool {
  1961. for v in &self.track {
  1962. if !v.is_initialized() {
  1963. return false;
  1964. }
  1965. };
  1966. for v in &self.ad {
  1967. if !v.is_initialized() {
  1968. return false;
  1969. }
  1970. };
  1971. true
  1972. }
  1973. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  1974. while !is.eof()? {
  1975. let (field_number, wire_type) = is.read_tag_unpack()?;
  1976. match field_number {
  1977. 2 => {
  1978. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.context_uri)?;
  1979. },
  1980. 3 => {
  1981. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1982. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1983. }
  1984. let tmp = is.read_uint32()?;
  1985. self.index = ::std::option::Option::Some(tmp);
  1986. },
  1987. 4 => {
  1988. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1989. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1990. }
  1991. let tmp = is.read_uint32()?;
  1992. self.position_ms = ::std::option::Option::Some(tmp);
  1993. },
  1994. 5 => {
  1995. ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.status, 5, &mut self.unknown_fields)?
  1996. },
  1997. 7 => {
  1998. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1999. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2000. }
  2001. let tmp = is.read_uint64()?;
  2002. self.position_measured_at = ::std::option::Option::Some(tmp);
  2003. },
  2004. 8 => {
  2005. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.context_description)?;
  2006. },
  2007. 13 => {
  2008. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2009. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2010. }
  2011. let tmp = is.read_bool()?;
  2012. self.shuffle = ::std::option::Option::Some(tmp);
  2013. },
  2014. 14 => {
  2015. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2016. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2017. }
  2018. let tmp = is.read_bool()?;
  2019. self.repeat = ::std::option::Option::Some(tmp);
  2020. },
  2021. 20 => {
  2022. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.last_command_ident)?;
  2023. },
  2024. 21 => {
  2025. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2026. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2027. }
  2028. let tmp = is.read_uint32()?;
  2029. self.last_command_msgid = ::std::option::Option::Some(tmp);
  2030. },
  2031. 24 => {
  2032. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2033. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2034. }
  2035. let tmp = is.read_bool()?;
  2036. self.playing_from_fallback = ::std::option::Option::Some(tmp);
  2037. },
  2038. 25 => {
  2039. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2040. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2041. }
  2042. let tmp = is.read_uint32()?;
  2043. self.row = ::std::option::Option::Some(tmp);
  2044. },
  2045. 26 => {
  2046. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2047. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2048. }
  2049. let tmp = is.read_uint32()?;
  2050. self.playing_track_index = ::std::option::Option::Some(tmp);
  2051. },
  2052. 27 => {
  2053. ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.track)?;
  2054. },
  2055. 28 => {
  2056. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.ad)?;
  2057. },
  2058. _ => {
  2059. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  2060. },
  2061. };
  2062. }
  2063. ::std::result::Result::Ok(())
  2064. }
  2065. // Compute sizes of nested messages
  2066. #[allow(unused_variables)]
  2067. fn compute_size(&self) -> u32 {
  2068. let mut my_size = 0;
  2069. if let Some(ref v) = self.context_uri.as_ref() {
  2070. my_size += ::protobuf::rt::string_size(2, &v);
  2071. }
  2072. if let Some(v) = self.index {
  2073. my_size += ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint);
  2074. }
  2075. if let Some(v) = self.position_ms {
  2076. my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint);
  2077. }
  2078. if let Some(v) = self.status {
  2079. my_size += ::protobuf::rt::enum_size(5, v);
  2080. }
  2081. if let Some(v) = self.position_measured_at {
  2082. my_size += ::protobuf::rt::value_size(7, v, ::protobuf::wire_format::WireTypeVarint);
  2083. }
  2084. if let Some(ref v) = self.context_description.as_ref() {
  2085. my_size += ::protobuf::rt::string_size(8, &v);
  2086. }
  2087. if let Some(v) = self.shuffle {
  2088. my_size += 2;
  2089. }
  2090. if let Some(v) = self.repeat {
  2091. my_size += 2;
  2092. }
  2093. if let Some(ref v) = self.last_command_ident.as_ref() {
  2094. my_size += ::protobuf::rt::string_size(20, &v);
  2095. }
  2096. if let Some(v) = self.last_command_msgid {
  2097. my_size += ::protobuf::rt::value_size(21, v, ::protobuf::wire_format::WireTypeVarint);
  2098. }
  2099. if let Some(v) = self.playing_from_fallback {
  2100. my_size += 3;
  2101. }
  2102. if let Some(v) = self.row {
  2103. my_size += ::protobuf::rt::value_size(25, v, ::protobuf::wire_format::WireTypeVarint);
  2104. }
  2105. if let Some(v) = self.playing_track_index {
  2106. my_size += ::protobuf::rt::value_size(26, v, ::protobuf::wire_format::WireTypeVarint);
  2107. }
  2108. for value in &self.track {
  2109. let len = value.compute_size();
  2110. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  2111. };
  2112. if let Some(ref v) = self.ad.as_ref() {
  2113. let len = v.compute_size();
  2114. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  2115. }
  2116. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2117. self.cached_size.set(my_size);
  2118. my_size
  2119. }
  2120. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  2121. if let Some(ref v) = self.context_uri.as_ref() {
  2122. os.write_string(2, &v)?;
  2123. }
  2124. if let Some(v) = self.index {
  2125. os.write_uint32(3, v)?;
  2126. }
  2127. if let Some(v) = self.position_ms {
  2128. os.write_uint32(4, v)?;
  2129. }
  2130. if let Some(v) = self.status {
  2131. os.write_enum(5, v.value())?;
  2132. }
  2133. if let Some(v) = self.position_measured_at {
  2134. os.write_uint64(7, v)?;
  2135. }
  2136. if let Some(ref v) = self.context_description.as_ref() {
  2137. os.write_string(8, &v)?;
  2138. }
  2139. if let Some(v) = self.shuffle {
  2140. os.write_bool(13, v)?;
  2141. }
  2142. if let Some(v) = self.repeat {
  2143. os.write_bool(14, v)?;
  2144. }
  2145. if let Some(ref v) = self.last_command_ident.as_ref() {
  2146. os.write_string(20, &v)?;
  2147. }
  2148. if let Some(v) = self.last_command_msgid {
  2149. os.write_uint32(21, v)?;
  2150. }
  2151. if let Some(v) = self.playing_from_fallback {
  2152. os.write_bool(24, v)?;
  2153. }
  2154. if let Some(v) = self.row {
  2155. os.write_uint32(25, v)?;
  2156. }
  2157. if let Some(v) = self.playing_track_index {
  2158. os.write_uint32(26, v)?;
  2159. }
  2160. for v in &self.track {
  2161. os.write_tag(27, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  2162. os.write_raw_varint32(v.get_cached_size())?;
  2163. v.write_to_with_cached_sizes(os)?;
  2164. };
  2165. if let Some(ref v) = self.ad.as_ref() {
  2166. os.write_tag(28, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  2167. os.write_raw_varint32(v.get_cached_size())?;
  2168. v.write_to_with_cached_sizes(os)?;
  2169. }
  2170. os.write_unknown_fields(self.get_unknown_fields())?;
  2171. ::std::result::Result::Ok(())
  2172. }
  2173. fn get_cached_size(&self) -> u32 {
  2174. self.cached_size.get()
  2175. }
  2176. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2177. &self.unknown_fields
  2178. }
  2179. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2180. &mut self.unknown_fields
  2181. }
  2182. fn as_any(&self) -> &dyn (::std::any::Any) {
  2183. self as &dyn (::std::any::Any)
  2184. }
  2185. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  2186. self as &mut dyn (::std::any::Any)
  2187. }
  2188. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  2189. self
  2190. }
  2191. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2192. Self::descriptor_static()
  2193. }
  2194. fn new() -> State {
  2195. State::new()
  2196. }
  2197. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2198. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  2199. lock: ::protobuf::lazy::ONCE_INIT,
  2200. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  2201. };
  2202. unsafe {
  2203. descriptor.get(|| {
  2204. let mut fields = ::std::vec::Vec::new();
  2205. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  2206. "context_uri",
  2207. |m: &State| { &m.context_uri },
  2208. |m: &mut State| { &mut m.context_uri },
  2209. ));
  2210. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
  2211. "index",
  2212. |m: &State| { &m.index },
  2213. |m: &mut State| { &mut m.index },
  2214. ));
  2215. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
  2216. "position_ms",
  2217. |m: &State| { &m.position_ms },
  2218. |m: &mut State| { &mut m.position_ms },
  2219. ));
  2220. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum<PlayStatus>>(
  2221. "status",
  2222. |m: &State| { &m.status },
  2223. |m: &mut State| { &mut m.status },
  2224. ));
  2225. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
  2226. "position_measured_at",
  2227. |m: &State| { &m.position_measured_at },
  2228. |m: &mut State| { &mut m.position_measured_at },
  2229. ));
  2230. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  2231. "context_description",
  2232. |m: &State| { &m.context_description },
  2233. |m: &mut State| { &mut m.context_description },
  2234. ));
  2235. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
  2236. "shuffle",
  2237. |m: &State| { &m.shuffle },
  2238. |m: &mut State| { &mut m.shuffle },
  2239. ));
  2240. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
  2241. "repeat",
  2242. |m: &State| { &m.repeat },
  2243. |m: &mut State| { &mut m.repeat },
  2244. ));
  2245. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  2246. "last_command_ident",
  2247. |m: &State| { &m.last_command_ident },
  2248. |m: &mut State| { &mut m.last_command_ident },
  2249. ));
  2250. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
  2251. "last_command_msgid",
  2252. |m: &State| { &m.last_command_msgid },
  2253. |m: &mut State| { &mut m.last_command_msgid },
  2254. ));
  2255. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
  2256. "playing_from_fallback",
  2257. |m: &State| { &m.playing_from_fallback },
  2258. |m: &mut State| { &mut m.playing_from_fallback },
  2259. ));
  2260. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
  2261. "row",
  2262. |m: &State| { &m.row },
  2263. |m: &mut State| { &mut m.row },
  2264. ));
  2265. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
  2266. "playing_track_index",
  2267. |m: &State| { &m.playing_track_index },
  2268. |m: &mut State| { &mut m.playing_track_index },
  2269. ));
  2270. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<TrackRef>>(
  2271. "track",
  2272. |m: &State| { &m.track },
  2273. |m: &mut State| { &mut m.track },
  2274. ));
  2275. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Ad>>(
  2276. "ad",
  2277. |m: &State| { &m.ad },
  2278. |m: &mut State| { &mut m.ad },
  2279. ));
  2280. ::protobuf::reflect::MessageDescriptor::new::<State>(
  2281. "State",
  2282. fields,
  2283. file_descriptor_proto()
  2284. )
  2285. })
  2286. }
  2287. }
  2288. fn default_instance() -> &'static State {
  2289. static mut instance: ::protobuf::lazy::Lazy<State> = ::protobuf::lazy::Lazy {
  2290. lock: ::protobuf::lazy::ONCE_INIT,
  2291. ptr: 0 as *const State,
  2292. };
  2293. unsafe {
  2294. instance.get(State::new)
  2295. }
  2296. }
  2297. }
  2298. impl ::protobuf::Clear for State {
  2299. fn clear(&mut self) {
  2300. self.context_uri.clear();
  2301. self.index = ::std::option::Option::None;
  2302. self.position_ms = ::std::option::Option::None;
  2303. self.status = ::std::option::Option::None;
  2304. self.position_measured_at = ::std::option::Option::None;
  2305. self.context_description.clear();
  2306. self.shuffle = ::std::option::Option::None;
  2307. self.repeat = ::std::option::Option::None;
  2308. self.last_command_ident.clear();
  2309. self.last_command_msgid = ::std::option::Option::None;
  2310. self.playing_from_fallback = ::std::option::Option::None;
  2311. self.row = ::std::option::Option::None;
  2312. self.playing_track_index = ::std::option::Option::None;
  2313. self.track.clear();
  2314. self.ad.clear();
  2315. self.unknown_fields.clear();
  2316. }
  2317. }
  2318. impl ::std::fmt::Debug for State {
  2319. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  2320. ::protobuf::text_format::fmt(self, f)
  2321. }
  2322. }
  2323. impl ::protobuf::reflect::ProtobufValue for State {
  2324. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  2325. ::protobuf::reflect::ProtobufValueRef::Message(self)
  2326. }
  2327. }
  2328. #[derive(PartialEq,Clone,Default)]
  2329. pub struct TrackRef {
  2330. // message fields
  2331. gid: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2332. uri: ::protobuf::SingularField<::std::string::String>,
  2333. queued: ::std::option::Option<bool>,
  2334. context: ::protobuf::SingularField<::std::string::String>,
  2335. // special fields
  2336. pub unknown_fields: ::protobuf::UnknownFields,
  2337. pub cached_size: ::protobuf::CachedSize,
  2338. }
  2339. impl<'a> ::std::default::Default for &'a TrackRef {
  2340. fn default() -> &'a TrackRef {
  2341. <TrackRef as ::protobuf::Message>::default_instance()
  2342. }
  2343. }
  2344. impl TrackRef {
  2345. pub fn new() -> TrackRef {
  2346. ::std::default::Default::default()
  2347. }
  2348. // optional bytes gid = 1;
  2349. pub fn get_gid(&self) -> &[u8] {
  2350. match self.gid.as_ref() {
  2351. Some(v) => &v,
  2352. None => &[],
  2353. }
  2354. }
  2355. pub fn clear_gid(&mut self) {
  2356. self.gid.clear();
  2357. }
  2358. pub fn has_gid(&self) -> bool {
  2359. self.gid.is_some()
  2360. }
  2361. // Param is passed by value, moved
  2362. pub fn set_gid(&mut self, v: ::std::vec::Vec<u8>) {
  2363. self.gid = ::protobuf::SingularField::some(v);
  2364. }
  2365. // Mutable pointer to the field.
  2366. // If field is not initialized, it is initialized with default value first.
  2367. pub fn mut_gid(&mut self) -> &mut ::std::vec::Vec<u8> {
  2368. if self.gid.is_none() {
  2369. self.gid.set_default();
  2370. }
  2371. self.gid.as_mut().unwrap()
  2372. }
  2373. // Take field
  2374. pub fn take_gid(&mut self) -> ::std::vec::Vec<u8> {
  2375. self.gid.take().unwrap_or_else(|| ::std::vec::Vec::new())
  2376. }
  2377. // optional string uri = 2;
  2378. pub fn get_uri(&self) -> &str {
  2379. match self.uri.as_ref() {
  2380. Some(v) => &v,
  2381. None => "",
  2382. }
  2383. }
  2384. pub fn clear_uri(&mut self) {
  2385. self.uri.clear();
  2386. }
  2387. pub fn has_uri(&self) -> bool {
  2388. self.uri.is_some()
  2389. }
  2390. // Param is passed by value, moved
  2391. pub fn set_uri(&mut self, v: ::std::string::String) {
  2392. self.uri = ::protobuf::SingularField::some(v);
  2393. }
  2394. // Mutable pointer to the field.
  2395. // If field is not initialized, it is initialized with default value first.
  2396. pub fn mut_uri(&mut self) -> &mut ::std::string::String {
  2397. if self.uri.is_none() {
  2398. self.uri.set_default();
  2399. }
  2400. self.uri.as_mut().unwrap()
  2401. }
  2402. // Take field
  2403. pub fn take_uri(&mut self) -> ::std::string::String {
  2404. self.uri.take().unwrap_or_else(|| ::std::string::String::new())
  2405. }
  2406. // optional bool queued = 3;
  2407. pub fn get_queued(&self) -> bool {
  2408. self.queued.unwrap_or(false)
  2409. }
  2410. pub fn clear_queued(&mut self) {
  2411. self.queued = ::std::option::Option::None;
  2412. }
  2413. pub fn has_queued(&self) -> bool {
  2414. self.queued.is_some()
  2415. }
  2416. // Param is passed by value, moved
  2417. pub fn set_queued(&mut self, v: bool) {
  2418. self.queued = ::std::option::Option::Some(v);
  2419. }
  2420. // optional string context = 4;
  2421. pub fn get_context(&self) -> &str {
  2422. match self.context.as_ref() {
  2423. Some(v) => &v,
  2424. None => "",
  2425. }
  2426. }
  2427. pub fn clear_context(&mut self) {
  2428. self.context.clear();
  2429. }
  2430. pub fn has_context(&self) -> bool {
  2431. self.context.is_some()
  2432. }
  2433. // Param is passed by value, moved
  2434. pub fn set_context(&mut self, v: ::std::string::String) {
  2435. self.context = ::protobuf::SingularField::some(v);
  2436. }
  2437. // Mutable pointer to the field.
  2438. // If field is not initialized, it is initialized with default value first.
  2439. pub fn mut_context(&mut self) -> &mut ::std::string::String {
  2440. if self.context.is_none() {
  2441. self.context.set_default();
  2442. }
  2443. self.context.as_mut().unwrap()
  2444. }
  2445. // Take field
  2446. pub fn take_context(&mut self) -> ::std::string::String {
  2447. self.context.take().unwrap_or_else(|| ::std::string::String::new())
  2448. }
  2449. }
  2450. impl ::protobuf::Message for TrackRef {
  2451. fn is_initialized(&self) -> bool {
  2452. true
  2453. }
  2454. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  2455. while !is.eof()? {
  2456. let (field_number, wire_type) = is.read_tag_unpack()?;
  2457. match field_number {
  2458. 1 => {
  2459. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)?;
  2460. },
  2461. 2 => {
  2462. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)?;
  2463. },
  2464. 3 => {
  2465. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2466. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2467. }
  2468. let tmp = is.read_bool()?;
  2469. self.queued = ::std::option::Option::Some(tmp);
  2470. },
  2471. 4 => {
  2472. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.context)?;
  2473. },
  2474. _ => {
  2475. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  2476. },
  2477. };
  2478. }
  2479. ::std::result::Result::Ok(())
  2480. }
  2481. // Compute sizes of nested messages
  2482. #[allow(unused_variables)]
  2483. fn compute_size(&self) -> u32 {
  2484. let mut my_size = 0;
  2485. if let Some(ref v) = self.gid.as_ref() {
  2486. my_size += ::protobuf::rt::bytes_size(1, &v);
  2487. }
  2488. if let Some(ref v) = self.uri.as_ref() {
  2489. my_size += ::protobuf::rt::string_size(2, &v);
  2490. }
  2491. if let Some(v) = self.queued {
  2492. my_size += 2;
  2493. }
  2494. if let Some(ref v) = self.context.as_ref() {
  2495. my_size += ::protobuf::rt::string_size(4, &v);
  2496. }
  2497. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2498. self.cached_size.set(my_size);
  2499. my_size
  2500. }
  2501. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  2502. if let Some(ref v) = self.gid.as_ref() {
  2503. os.write_bytes(1, &v)?;
  2504. }
  2505. if let Some(ref v) = self.uri.as_ref() {
  2506. os.write_string(2, &v)?;
  2507. }
  2508. if let Some(v) = self.queued {
  2509. os.write_bool(3, v)?;
  2510. }
  2511. if let Some(ref v) = self.context.as_ref() {
  2512. os.write_string(4, &v)?;
  2513. }
  2514. os.write_unknown_fields(self.get_unknown_fields())?;
  2515. ::std::result::Result::Ok(())
  2516. }
  2517. fn get_cached_size(&self) -> u32 {
  2518. self.cached_size.get()
  2519. }
  2520. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2521. &self.unknown_fields
  2522. }
  2523. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2524. &mut self.unknown_fields
  2525. }
  2526. fn as_any(&self) -> &dyn (::std::any::Any) {
  2527. self as &dyn (::std::any::Any)
  2528. }
  2529. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  2530. self as &mut dyn (::std::any::Any)
  2531. }
  2532. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  2533. self
  2534. }
  2535. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2536. Self::descriptor_static()
  2537. }
  2538. fn new() -> TrackRef {
  2539. TrackRef::new()
  2540. }
  2541. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2542. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  2543. lock: ::protobuf::lazy::ONCE_INIT,
  2544. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  2545. };
  2546. unsafe {
  2547. descriptor.get(|| {
  2548. let mut fields = ::std::vec::Vec::new();
  2549. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  2550. "gid",
  2551. |m: &TrackRef| { &m.gid },
  2552. |m: &mut TrackRef| { &mut m.gid },
  2553. ));
  2554. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  2555. "uri",
  2556. |m: &TrackRef| { &m.uri },
  2557. |m: &mut TrackRef| { &mut m.uri },
  2558. ));
  2559. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
  2560. "queued",
  2561. |m: &TrackRef| { &m.queued },
  2562. |m: &mut TrackRef| { &mut m.queued },
  2563. ));
  2564. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  2565. "context",
  2566. |m: &TrackRef| { &m.context },
  2567. |m: &mut TrackRef| { &mut m.context },
  2568. ));
  2569. ::protobuf::reflect::MessageDescriptor::new::<TrackRef>(
  2570. "TrackRef",
  2571. fields,
  2572. file_descriptor_proto()
  2573. )
  2574. })
  2575. }
  2576. }
  2577. fn default_instance() -> &'static TrackRef {
  2578. static mut instance: ::protobuf::lazy::Lazy<TrackRef> = ::protobuf::lazy::Lazy {
  2579. lock: ::protobuf::lazy::ONCE_INIT,
  2580. ptr: 0 as *const TrackRef,
  2581. };
  2582. unsafe {
  2583. instance.get(TrackRef::new)
  2584. }
  2585. }
  2586. }
  2587. impl ::protobuf::Clear for TrackRef {
  2588. fn clear(&mut self) {
  2589. self.gid.clear();
  2590. self.uri.clear();
  2591. self.queued = ::std::option::Option::None;
  2592. self.context.clear();
  2593. self.unknown_fields.clear();
  2594. }
  2595. }
  2596. impl ::std::fmt::Debug for TrackRef {
  2597. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  2598. ::protobuf::text_format::fmt(self, f)
  2599. }
  2600. }
  2601. impl ::protobuf::reflect::ProtobufValue for TrackRef {
  2602. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  2603. ::protobuf::reflect::ProtobufValueRef::Message(self)
  2604. }
  2605. }
  2606. #[derive(PartialEq,Clone,Default)]
  2607. pub struct Ad {
  2608. // message fields
  2609. next: ::std::option::Option<i32>,
  2610. ogg_fid: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2611. image_fid: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2612. duration: ::std::option::Option<i32>,
  2613. click_url: ::protobuf::SingularField<::std::string::String>,
  2614. impression_url: ::protobuf::SingularField<::std::string::String>,
  2615. product: ::protobuf::SingularField<::std::string::String>,
  2616. advertiser: ::protobuf::SingularField<::std::string::String>,
  2617. gid: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2618. // special fields
  2619. pub unknown_fields: ::protobuf::UnknownFields,
  2620. pub cached_size: ::protobuf::CachedSize,
  2621. }
  2622. impl<'a> ::std::default::Default for &'a Ad {
  2623. fn default() -> &'a Ad {
  2624. <Ad as ::protobuf::Message>::default_instance()
  2625. }
  2626. }
  2627. impl Ad {
  2628. pub fn new() -> Ad {
  2629. ::std::default::Default::default()
  2630. }
  2631. // optional int32 next = 1;
  2632. pub fn get_next(&self) -> i32 {
  2633. self.next.unwrap_or(0)
  2634. }
  2635. pub fn clear_next(&mut self) {
  2636. self.next = ::std::option::Option::None;
  2637. }
  2638. pub fn has_next(&self) -> bool {
  2639. self.next.is_some()
  2640. }
  2641. // Param is passed by value, moved
  2642. pub fn set_next(&mut self, v: i32) {
  2643. self.next = ::std::option::Option::Some(v);
  2644. }
  2645. // optional bytes ogg_fid = 2;
  2646. pub fn get_ogg_fid(&self) -> &[u8] {
  2647. match self.ogg_fid.as_ref() {
  2648. Some(v) => &v,
  2649. None => &[],
  2650. }
  2651. }
  2652. pub fn clear_ogg_fid(&mut self) {
  2653. self.ogg_fid.clear();
  2654. }
  2655. pub fn has_ogg_fid(&self) -> bool {
  2656. self.ogg_fid.is_some()
  2657. }
  2658. // Param is passed by value, moved
  2659. pub fn set_ogg_fid(&mut self, v: ::std::vec::Vec<u8>) {
  2660. self.ogg_fid = ::protobuf::SingularField::some(v);
  2661. }
  2662. // Mutable pointer to the field.
  2663. // If field is not initialized, it is initialized with default value first.
  2664. pub fn mut_ogg_fid(&mut self) -> &mut ::std::vec::Vec<u8> {
  2665. if self.ogg_fid.is_none() {
  2666. self.ogg_fid.set_default();
  2667. }
  2668. self.ogg_fid.as_mut().unwrap()
  2669. }
  2670. // Take field
  2671. pub fn take_ogg_fid(&mut self) -> ::std::vec::Vec<u8> {
  2672. self.ogg_fid.take().unwrap_or_else(|| ::std::vec::Vec::new())
  2673. }
  2674. // optional bytes image_fid = 3;
  2675. pub fn get_image_fid(&self) -> &[u8] {
  2676. match self.image_fid.as_ref() {
  2677. Some(v) => &v,
  2678. None => &[],
  2679. }
  2680. }
  2681. pub fn clear_image_fid(&mut self) {
  2682. self.image_fid.clear();
  2683. }
  2684. pub fn has_image_fid(&self) -> bool {
  2685. self.image_fid.is_some()
  2686. }
  2687. // Param is passed by value, moved
  2688. pub fn set_image_fid(&mut self, v: ::std::vec::Vec<u8>) {
  2689. self.image_fid = ::protobuf::SingularField::some(v);
  2690. }
  2691. // Mutable pointer to the field.
  2692. // If field is not initialized, it is initialized with default value first.
  2693. pub fn mut_image_fid(&mut self) -> &mut ::std::vec::Vec<u8> {
  2694. if self.image_fid.is_none() {
  2695. self.image_fid.set_default();
  2696. }
  2697. self.image_fid.as_mut().unwrap()
  2698. }
  2699. // Take field
  2700. pub fn take_image_fid(&mut self) -> ::std::vec::Vec<u8> {
  2701. self.image_fid.take().unwrap_or_else(|| ::std::vec::Vec::new())
  2702. }
  2703. // optional int32 duration = 4;
  2704. pub fn get_duration(&self) -> i32 {
  2705. self.duration.unwrap_or(0)
  2706. }
  2707. pub fn clear_duration(&mut self) {
  2708. self.duration = ::std::option::Option::None;
  2709. }
  2710. pub fn has_duration(&self) -> bool {
  2711. self.duration.is_some()
  2712. }
  2713. // Param is passed by value, moved
  2714. pub fn set_duration(&mut self, v: i32) {
  2715. self.duration = ::std::option::Option::Some(v);
  2716. }
  2717. // optional string click_url = 5;
  2718. pub fn get_click_url(&self) -> &str {
  2719. match self.click_url.as_ref() {
  2720. Some(v) => &v,
  2721. None => "",
  2722. }
  2723. }
  2724. pub fn clear_click_url(&mut self) {
  2725. self.click_url.clear();
  2726. }
  2727. pub fn has_click_url(&self) -> bool {
  2728. self.click_url.is_some()
  2729. }
  2730. // Param is passed by value, moved
  2731. pub fn set_click_url(&mut self, v: ::std::string::String) {
  2732. self.click_url = ::protobuf::SingularField::some(v);
  2733. }
  2734. // Mutable pointer to the field.
  2735. // If field is not initialized, it is initialized with default value first.
  2736. pub fn mut_click_url(&mut self) -> &mut ::std::string::String {
  2737. if self.click_url.is_none() {
  2738. self.click_url.set_default();
  2739. }
  2740. self.click_url.as_mut().unwrap()
  2741. }
  2742. // Take field
  2743. pub fn take_click_url(&mut self) -> ::std::string::String {
  2744. self.click_url.take().unwrap_or_else(|| ::std::string::String::new())
  2745. }
  2746. // optional string impression_url = 6;
  2747. pub fn get_impression_url(&self) -> &str {
  2748. match self.impression_url.as_ref() {
  2749. Some(v) => &v,
  2750. None => "",
  2751. }
  2752. }
  2753. pub fn clear_impression_url(&mut self) {
  2754. self.impression_url.clear();
  2755. }
  2756. pub fn has_impression_url(&self) -> bool {
  2757. self.impression_url.is_some()
  2758. }
  2759. // Param is passed by value, moved
  2760. pub fn set_impression_url(&mut self, v: ::std::string::String) {
  2761. self.impression_url = ::protobuf::SingularField::some(v);
  2762. }
  2763. // Mutable pointer to the field.
  2764. // If field is not initialized, it is initialized with default value first.
  2765. pub fn mut_impression_url(&mut self) -> &mut ::std::string::String {
  2766. if self.impression_url.is_none() {
  2767. self.impression_url.set_default();
  2768. }
  2769. self.impression_url.as_mut().unwrap()
  2770. }
  2771. // Take field
  2772. pub fn take_impression_url(&mut self) -> ::std::string::String {
  2773. self.impression_url.take().unwrap_or_else(|| ::std::string::String::new())
  2774. }
  2775. // optional string product = 7;
  2776. pub fn get_product(&self) -> &str {
  2777. match self.product.as_ref() {
  2778. Some(v) => &v,
  2779. None => "",
  2780. }
  2781. }
  2782. pub fn clear_product(&mut self) {
  2783. self.product.clear();
  2784. }
  2785. pub fn has_product(&self) -> bool {
  2786. self.product.is_some()
  2787. }
  2788. // Param is passed by value, moved
  2789. pub fn set_product(&mut self, v: ::std::string::String) {
  2790. self.product = ::protobuf::SingularField::some(v);
  2791. }
  2792. // Mutable pointer to the field.
  2793. // If field is not initialized, it is initialized with default value first.
  2794. pub fn mut_product(&mut self) -> &mut ::std::string::String {
  2795. if self.product.is_none() {
  2796. self.product.set_default();
  2797. }
  2798. self.product.as_mut().unwrap()
  2799. }
  2800. // Take field
  2801. pub fn take_product(&mut self) -> ::std::string::String {
  2802. self.product.take().unwrap_or_else(|| ::std::string::String::new())
  2803. }
  2804. // optional string advertiser = 8;
  2805. pub fn get_advertiser(&self) -> &str {
  2806. match self.advertiser.as_ref() {
  2807. Some(v) => &v,
  2808. None => "",
  2809. }
  2810. }
  2811. pub fn clear_advertiser(&mut self) {
  2812. self.advertiser.clear();
  2813. }
  2814. pub fn has_advertiser(&self) -> bool {
  2815. self.advertiser.is_some()
  2816. }
  2817. // Param is passed by value, moved
  2818. pub fn set_advertiser(&mut self, v: ::std::string::String) {
  2819. self.advertiser = ::protobuf::SingularField::some(v);
  2820. }
  2821. // Mutable pointer to the field.
  2822. // If field is not initialized, it is initialized with default value first.
  2823. pub fn mut_advertiser(&mut self) -> &mut ::std::string::String {
  2824. if self.advertiser.is_none() {
  2825. self.advertiser.set_default();
  2826. }
  2827. self.advertiser.as_mut().unwrap()
  2828. }
  2829. // Take field
  2830. pub fn take_advertiser(&mut self) -> ::std::string::String {
  2831. self.advertiser.take().unwrap_or_else(|| ::std::string::String::new())
  2832. }
  2833. // optional bytes gid = 9;
  2834. pub fn get_gid(&self) -> &[u8] {
  2835. match self.gid.as_ref() {
  2836. Some(v) => &v,
  2837. None => &[],
  2838. }
  2839. }
  2840. pub fn clear_gid(&mut self) {
  2841. self.gid.clear();
  2842. }
  2843. pub fn has_gid(&self) -> bool {
  2844. self.gid.is_some()
  2845. }
  2846. // Param is passed by value, moved
  2847. pub fn set_gid(&mut self, v: ::std::vec::Vec<u8>) {
  2848. self.gid = ::protobuf::SingularField::some(v);
  2849. }
  2850. // Mutable pointer to the field.
  2851. // If field is not initialized, it is initialized with default value first.
  2852. pub fn mut_gid(&mut self) -> &mut ::std::vec::Vec<u8> {
  2853. if self.gid.is_none() {
  2854. self.gid.set_default();
  2855. }
  2856. self.gid.as_mut().unwrap()
  2857. }
  2858. // Take field
  2859. pub fn take_gid(&mut self) -> ::std::vec::Vec<u8> {
  2860. self.gid.take().unwrap_or_else(|| ::std::vec::Vec::new())
  2861. }
  2862. }
  2863. impl ::protobuf::Message for Ad {
  2864. fn is_initialized(&self) -> bool {
  2865. true
  2866. }
  2867. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  2868. while !is.eof()? {
  2869. let (field_number, wire_type) = is.read_tag_unpack()?;
  2870. match field_number {
  2871. 1 => {
  2872. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2873. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2874. }
  2875. let tmp = is.read_int32()?;
  2876. self.next = ::std::option::Option::Some(tmp);
  2877. },
  2878. 2 => {
  2879. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.ogg_fid)?;
  2880. },
  2881. 3 => {
  2882. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.image_fid)?;
  2883. },
  2884. 4 => {
  2885. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2886. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2887. }
  2888. let tmp = is.read_int32()?;
  2889. self.duration = ::std::option::Option::Some(tmp);
  2890. },
  2891. 5 => {
  2892. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.click_url)?;
  2893. },
  2894. 6 => {
  2895. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.impression_url)?;
  2896. },
  2897. 7 => {
  2898. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.product)?;
  2899. },
  2900. 8 => {
  2901. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.advertiser)?;
  2902. },
  2903. 9 => {
  2904. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)?;
  2905. },
  2906. _ => {
  2907. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  2908. },
  2909. };
  2910. }
  2911. ::std::result::Result::Ok(())
  2912. }
  2913. // Compute sizes of nested messages
  2914. #[allow(unused_variables)]
  2915. fn compute_size(&self) -> u32 {
  2916. let mut my_size = 0;
  2917. if let Some(v) = self.next {
  2918. my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
  2919. }
  2920. if let Some(ref v) = self.ogg_fid.as_ref() {
  2921. my_size += ::protobuf::rt::bytes_size(2, &v);
  2922. }
  2923. if let Some(ref v) = self.image_fid.as_ref() {
  2924. my_size += ::protobuf::rt::bytes_size(3, &v);
  2925. }
  2926. if let Some(v) = self.duration {
  2927. my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint);
  2928. }
  2929. if let Some(ref v) = self.click_url.as_ref() {
  2930. my_size += ::protobuf::rt::string_size(5, &v);
  2931. }
  2932. if let Some(ref v) = self.impression_url.as_ref() {
  2933. my_size += ::protobuf::rt::string_size(6, &v);
  2934. }
  2935. if let Some(ref v) = self.product.as_ref() {
  2936. my_size += ::protobuf::rt::string_size(7, &v);
  2937. }
  2938. if let Some(ref v) = self.advertiser.as_ref() {
  2939. my_size += ::protobuf::rt::string_size(8, &v);
  2940. }
  2941. if let Some(ref v) = self.gid.as_ref() {
  2942. my_size += ::protobuf::rt::bytes_size(9, &v);
  2943. }
  2944. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2945. self.cached_size.set(my_size);
  2946. my_size
  2947. }
  2948. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  2949. if let Some(v) = self.next {
  2950. os.write_int32(1, v)?;
  2951. }
  2952. if let Some(ref v) = self.ogg_fid.as_ref() {
  2953. os.write_bytes(2, &v)?;
  2954. }
  2955. if let Some(ref v) = self.image_fid.as_ref() {
  2956. os.write_bytes(3, &v)?;
  2957. }
  2958. if let Some(v) = self.duration {
  2959. os.write_int32(4, v)?;
  2960. }
  2961. if let Some(ref v) = self.click_url.as_ref() {
  2962. os.write_string(5, &v)?;
  2963. }
  2964. if let Some(ref v) = self.impression_url.as_ref() {
  2965. os.write_string(6, &v)?;
  2966. }
  2967. if let Some(ref v) = self.product.as_ref() {
  2968. os.write_string(7, &v)?;
  2969. }
  2970. if let Some(ref v) = self.advertiser.as_ref() {
  2971. os.write_string(8, &v)?;
  2972. }
  2973. if let Some(ref v) = self.gid.as_ref() {
  2974. os.write_bytes(9, &v)?;
  2975. }
  2976. os.write_unknown_fields(self.get_unknown_fields())?;
  2977. ::std::result::Result::Ok(())
  2978. }
  2979. fn get_cached_size(&self) -> u32 {
  2980. self.cached_size.get()
  2981. }
  2982. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2983. &self.unknown_fields
  2984. }
  2985. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2986. &mut self.unknown_fields
  2987. }
  2988. fn as_any(&self) -> &dyn (::std::any::Any) {
  2989. self as &dyn (::std::any::Any)
  2990. }
  2991. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  2992. self as &mut dyn (::std::any::Any)
  2993. }
  2994. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  2995. self
  2996. }
  2997. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2998. Self::descriptor_static()
  2999. }
  3000. fn new() -> Ad {
  3001. Ad::new()
  3002. }
  3003. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  3004. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  3005. lock: ::protobuf::lazy::ONCE_INIT,
  3006. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  3007. };
  3008. unsafe {
  3009. descriptor.get(|| {
  3010. let mut fields = ::std::vec::Vec::new();
  3011. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  3012. "next",
  3013. |m: &Ad| { &m.next },
  3014. |m: &mut Ad| { &mut m.next },
  3015. ));
  3016. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  3017. "ogg_fid",
  3018. |m: &Ad| { &m.ogg_fid },
  3019. |m: &mut Ad| { &mut m.ogg_fid },
  3020. ));
  3021. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  3022. "image_fid",
  3023. |m: &Ad| { &m.image_fid },
  3024. |m: &mut Ad| { &mut m.image_fid },
  3025. ));
  3026. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  3027. "duration",
  3028. |m: &Ad| { &m.duration },
  3029. |m: &mut Ad| { &mut m.duration },
  3030. ));
  3031. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  3032. "click_url",
  3033. |m: &Ad| { &m.click_url },
  3034. |m: &mut Ad| { &mut m.click_url },
  3035. ));
  3036. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  3037. "impression_url",
  3038. |m: &Ad| { &m.impression_url },
  3039. |m: &mut Ad| { &mut m.impression_url },
  3040. ));
  3041. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  3042. "product",
  3043. |m: &Ad| { &m.product },
  3044. |m: &mut Ad| { &mut m.product },
  3045. ));
  3046. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  3047. "advertiser",
  3048. |m: &Ad| { &m.advertiser },
  3049. |m: &mut Ad| { &mut m.advertiser },
  3050. ));
  3051. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  3052. "gid",
  3053. |m: &Ad| { &m.gid },
  3054. |m: &mut Ad| { &mut m.gid },
  3055. ));
  3056. ::protobuf::reflect::MessageDescriptor::new::<Ad>(
  3057. "Ad",
  3058. fields,
  3059. file_descriptor_proto()
  3060. )
  3061. })
  3062. }
  3063. }
  3064. fn default_instance() -> &'static Ad {
  3065. static mut instance: ::protobuf::lazy::Lazy<Ad> = ::protobuf::lazy::Lazy {
  3066. lock: ::protobuf::lazy::ONCE_INIT,
  3067. ptr: 0 as *const Ad,
  3068. };
  3069. unsafe {
  3070. instance.get(Ad::new)
  3071. }
  3072. }
  3073. }
  3074. impl ::protobuf::Clear for Ad {
  3075. fn clear(&mut self) {
  3076. self.next = ::std::option::Option::None;
  3077. self.ogg_fid.clear();
  3078. self.image_fid.clear();
  3079. self.duration = ::std::option::Option::None;
  3080. self.click_url.clear();
  3081. self.impression_url.clear();
  3082. self.product.clear();
  3083. self.advertiser.clear();
  3084. self.gid.clear();
  3085. self.unknown_fields.clear();
  3086. }
  3087. }
  3088. impl ::std::fmt::Debug for Ad {
  3089. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  3090. ::protobuf::text_format::fmt(self, f)
  3091. }
  3092. }
  3093. impl ::protobuf::reflect::ProtobufValue for Ad {
  3094. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  3095. ::protobuf::reflect::ProtobufValueRef::Message(self)
  3096. }
  3097. }
  3098. #[derive(PartialEq,Clone,Default)]
  3099. pub struct Metadata {
  3100. // message fields
  3101. field_type: ::protobuf::SingularField<::std::string::String>,
  3102. metadata: ::protobuf::SingularField<::std::string::String>,
  3103. // special fields
  3104. pub unknown_fields: ::protobuf::UnknownFields,
  3105. pub cached_size: ::protobuf::CachedSize,
  3106. }
  3107. impl<'a> ::std::default::Default for &'a Metadata {
  3108. fn default() -> &'a Metadata {
  3109. <Metadata as ::protobuf::Message>::default_instance()
  3110. }
  3111. }
  3112. impl Metadata {
  3113. pub fn new() -> Metadata {
  3114. ::std::default::Default::default()
  3115. }
  3116. // optional string type = 1;
  3117. pub fn get_field_type(&self) -> &str {
  3118. match self.field_type.as_ref() {
  3119. Some(v) => &v,
  3120. None => "",
  3121. }
  3122. }
  3123. pub fn clear_field_type(&mut self) {
  3124. self.field_type.clear();
  3125. }
  3126. pub fn has_field_type(&self) -> bool {
  3127. self.field_type.is_some()
  3128. }
  3129. // Param is passed by value, moved
  3130. pub fn set_field_type(&mut self, v: ::std::string::String) {
  3131. self.field_type = ::protobuf::SingularField::some(v);
  3132. }
  3133. // Mutable pointer to the field.
  3134. // If field is not initialized, it is initialized with default value first.
  3135. pub fn mut_field_type(&mut self) -> &mut ::std::string::String {
  3136. if self.field_type.is_none() {
  3137. self.field_type.set_default();
  3138. }
  3139. self.field_type.as_mut().unwrap()
  3140. }
  3141. // Take field
  3142. pub fn take_field_type(&mut self) -> ::std::string::String {
  3143. self.field_type.take().unwrap_or_else(|| ::std::string::String::new())
  3144. }
  3145. // optional string metadata = 2;
  3146. pub fn get_metadata(&self) -> &str {
  3147. match self.metadata.as_ref() {
  3148. Some(v) => &v,
  3149. None => "",
  3150. }
  3151. }
  3152. pub fn clear_metadata(&mut self) {
  3153. self.metadata.clear();
  3154. }
  3155. pub fn has_metadata(&self) -> bool {
  3156. self.metadata.is_some()
  3157. }
  3158. // Param is passed by value, moved
  3159. pub fn set_metadata(&mut self, v: ::std::string::String) {
  3160. self.metadata = ::protobuf::SingularField::some(v);
  3161. }
  3162. // Mutable pointer to the field.
  3163. // If field is not initialized, it is initialized with default value first.
  3164. pub fn mut_metadata(&mut self) -> &mut ::std::string::String {
  3165. if self.metadata.is_none() {
  3166. self.metadata.set_default();
  3167. }
  3168. self.metadata.as_mut().unwrap()
  3169. }
  3170. // Take field
  3171. pub fn take_metadata(&mut self) -> ::std::string::String {
  3172. self.metadata.take().unwrap_or_else(|| ::std::string::String::new())
  3173. }
  3174. }
  3175. impl ::protobuf::Message for Metadata {
  3176. fn is_initialized(&self) -> bool {
  3177. true
  3178. }
  3179. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  3180. while !is.eof()? {
  3181. let (field_number, wire_type) = is.read_tag_unpack()?;
  3182. match field_number {
  3183. 1 => {
  3184. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.field_type)?;
  3185. },
  3186. 2 => {
  3187. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.metadata)?;
  3188. },
  3189. _ => {
  3190. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  3191. },
  3192. };
  3193. }
  3194. ::std::result::Result::Ok(())
  3195. }
  3196. // Compute sizes of nested messages
  3197. #[allow(unused_variables)]
  3198. fn compute_size(&self) -> u32 {
  3199. let mut my_size = 0;
  3200. if let Some(ref v) = self.field_type.as_ref() {
  3201. my_size += ::protobuf::rt::string_size(1, &v);
  3202. }
  3203. if let Some(ref v) = self.metadata.as_ref() {
  3204. my_size += ::protobuf::rt::string_size(2, &v);
  3205. }
  3206. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  3207. self.cached_size.set(my_size);
  3208. my_size
  3209. }
  3210. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
  3211. if let Some(ref v) = self.field_type.as_ref() {
  3212. os.write_string(1, &v)?;
  3213. }
  3214. if let Some(ref v) = self.metadata.as_ref() {
  3215. os.write_string(2, &v)?;
  3216. }
  3217. os.write_unknown_fields(self.get_unknown_fields())?;
  3218. ::std::result::Result::Ok(())
  3219. }
  3220. fn get_cached_size(&self) -> u32 {
  3221. self.cached_size.get()
  3222. }
  3223. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  3224. &self.unknown_fields
  3225. }
  3226. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  3227. &mut self.unknown_fields
  3228. }
  3229. fn as_any(&self) -> &dyn (::std::any::Any) {
  3230. self as &dyn (::std::any::Any)
  3231. }
  3232. fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
  3233. self as &mut dyn (::std::any::Any)
  3234. }
  3235. fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
  3236. self
  3237. }
  3238. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  3239. Self::descriptor_static()
  3240. }
  3241. fn new() -> Metadata {
  3242. Metadata::new()
  3243. }
  3244. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  3245. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  3246. lock: ::protobuf::lazy::ONCE_INIT,
  3247. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  3248. };
  3249. unsafe {
  3250. descriptor.get(|| {
  3251. let mut fields = ::std::vec::Vec::new();
  3252. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  3253. "type",
  3254. |m: &Metadata| { &m.field_type },
  3255. |m: &mut Metadata| { &mut m.field_type },
  3256. ));
  3257. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  3258. "metadata",
  3259. |m: &Metadata| { &m.metadata },
  3260. |m: &mut Metadata| { &mut m.metadata },
  3261. ));
  3262. ::protobuf::reflect::MessageDescriptor::new::<Metadata>(
  3263. "Metadata",
  3264. fields,
  3265. file_descriptor_proto()
  3266. )
  3267. })
  3268. }
  3269. }
  3270. fn default_instance() -> &'static Metadata {
  3271. static mut instance: ::protobuf::lazy::Lazy<Metadata> = ::protobuf::lazy::Lazy {
  3272. lock: ::protobuf::lazy::ONCE_INIT,
  3273. ptr: 0 as *const Metadata,
  3274. };
  3275. unsafe {
  3276. instance.get(Metadata::new)
  3277. }
  3278. }
  3279. }
  3280. impl ::protobuf::Clear for Metadata {
  3281. fn clear(&mut self) {
  3282. self.field_type.clear();
  3283. self.metadata.clear();
  3284. self.unknown_fields.clear();
  3285. }
  3286. }
  3287. impl ::std::fmt::Debug for Metadata {
  3288. fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
  3289. ::protobuf::text_format::fmt(self, f)
  3290. }
  3291. }
  3292. impl ::protobuf::reflect::ProtobufValue for Metadata {
  3293. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  3294. ::protobuf::reflect::ProtobufValueRef::Message(self)
  3295. }
  3296. }
  3297. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  3298. pub enum MessageType {
  3299. kMessageTypeHello = 1,
  3300. kMessageTypeGoodbye = 2,
  3301. kMessageTypeProbe = 3,
  3302. kMessageTypeNotify = 10,
  3303. kMessageTypeLoad = 20,
  3304. kMessageTypePlay = 21,
  3305. kMessageTypePause = 22,
  3306. kMessageTypePlayPause = 23,
  3307. kMessageTypeSeek = 24,
  3308. kMessageTypePrev = 25,
  3309. kMessageTypeNext = 26,
  3310. kMessageTypeVolume = 27,
  3311. kMessageTypeShuffle = 28,
  3312. kMessageTypeRepeat = 29,
  3313. kMessageTypeVolumeDown = 31,
  3314. kMessageTypeVolumeUp = 32,
  3315. kMessageTypeReplace = 33,
  3316. kMessageTypeLogout = 34,
  3317. kMessageTypeAction = 35,
  3318. kMessageTypeRename = 36,
  3319. kMessageTypeUpdateMetadata = 128,
  3320. }
  3321. impl ::protobuf::ProtobufEnum for MessageType {
  3322. fn value(&self) -> i32 {
  3323. *self as i32
  3324. }
  3325. fn from_i32(value: i32) -> ::std::option::Option<MessageType> {
  3326. match value {
  3327. 1 => ::std::option::Option::Some(MessageType::kMessageTypeHello),
  3328. 2 => ::std::option::Option::Some(MessageType::kMessageTypeGoodbye),
  3329. 3 => ::std::option::Option::Some(MessageType::kMessageTypeProbe),
  3330. 10 => ::std::option::Option::Some(MessageType::kMessageTypeNotify),
  3331. 20 => ::std::option::Option::Some(MessageType::kMessageTypeLoad),
  3332. 21 => ::std::option::Option::Some(MessageType::kMessageTypePlay),
  3333. 22 => ::std::option::Option::Some(MessageType::kMessageTypePause),
  3334. 23 => ::std::option::Option::Some(MessageType::kMessageTypePlayPause),
  3335. 24 => ::std::option::Option::Some(MessageType::kMessageTypeSeek),
  3336. 25 => ::std::option::Option::Some(MessageType::kMessageTypePrev),
  3337. 26 => ::std::option::Option::Some(MessageType::kMessageTypeNext),
  3338. 27 => ::std::option::Option::Some(MessageType::kMessageTypeVolume),
  3339. 28 => ::std::option::Option::Some(MessageType::kMessageTypeShuffle),
  3340. 29 => ::std::option::Option::Some(MessageType::kMessageTypeRepeat),
  3341. 31 => ::std::option::Option::Some(MessageType::kMessageTypeVolumeDown),
  3342. 32 => ::std::option::Option::Some(MessageType::kMessageTypeVolumeUp),
  3343. 33 => ::std::option::Option::Some(MessageType::kMessageTypeReplace),
  3344. 34 => ::std::option::Option::Some(MessageType::kMessageTypeLogout),
  3345. 35 => ::std::option::Option::Some(MessageType::kMessageTypeAction),
  3346. 36 => ::std::option::Option::Some(MessageType::kMessageTypeRename),
  3347. 128 => ::std::option::Option::Some(MessageType::kMessageTypeUpdateMetadata),
  3348. _ => ::std::option::Option::None
  3349. }
  3350. }
  3351. fn values() -> &'static [Self] {
  3352. static values: &'static [MessageType] = &[
  3353. MessageType::kMessageTypeHello,
  3354. MessageType::kMessageTypeGoodbye,
  3355. MessageType::kMessageTypeProbe,
  3356. MessageType::kMessageTypeNotify,
  3357. MessageType::kMessageTypeLoad,
  3358. MessageType::kMessageTypePlay,
  3359. MessageType::kMessageTypePause,
  3360. MessageType::kMessageTypePlayPause,
  3361. MessageType::kMessageTypeSeek,
  3362. MessageType::kMessageTypePrev,
  3363. MessageType::kMessageTypeNext,
  3364. MessageType::kMessageTypeVolume,
  3365. MessageType::kMessageTypeShuffle,
  3366. MessageType::kMessageTypeRepeat,
  3367. MessageType::kMessageTypeVolumeDown,
  3368. MessageType::kMessageTypeVolumeUp,
  3369. MessageType::kMessageTypeReplace,
  3370. MessageType::kMessageTypeLogout,
  3371. MessageType::kMessageTypeAction,
  3372. MessageType::kMessageTypeRename,
  3373. MessageType::kMessageTypeUpdateMetadata,
  3374. ];
  3375. values
  3376. }
  3377. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  3378. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
  3379. lock: ::protobuf::lazy::ONCE_INIT,
  3380. ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
  3381. };
  3382. unsafe {
  3383. descriptor.get(|| {
  3384. ::protobuf::reflect::EnumDescriptor::new("MessageType", file_descriptor_proto())
  3385. })
  3386. }
  3387. }
  3388. }
  3389. impl ::std::marker::Copy for MessageType {
  3390. }
  3391. // Note, `Default` is implemented although default value is not 0
  3392. impl ::std::default::Default for MessageType {
  3393. fn default() -> Self {
  3394. MessageType::kMessageTypeHello
  3395. }
  3396. }
  3397. impl ::protobuf::reflect::ProtobufValue for MessageType {
  3398. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  3399. ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
  3400. }
  3401. }
  3402. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  3403. pub enum CapabilityType {
  3404. kSupportedContexts = 1,
  3405. kCanBePlayer = 2,
  3406. kRestrictToLocal = 3,
  3407. kDeviceType = 4,
  3408. kGaiaEqConnectId = 5,
  3409. kSupportsLogout = 6,
  3410. kIsObservable = 7,
  3411. kVolumeSteps = 8,
  3412. kSupportedTypes = 9,
  3413. kCommandAcks = 10,
  3414. kSupportsRename = 11,
  3415. kHidden = 12,
  3416. kSupportsPlaylistV2 = 13,
  3417. kSupportsExternalEpisodes = 14,
  3418. }
  3419. impl ::protobuf::ProtobufEnum for CapabilityType {
  3420. fn value(&self) -> i32 {
  3421. *self as i32
  3422. }
  3423. fn from_i32(value: i32) -> ::std::option::Option<CapabilityType> {
  3424. match value {
  3425. 1 => ::std::option::Option::Some(CapabilityType::kSupportedContexts),
  3426. 2 => ::std::option::Option::Some(CapabilityType::kCanBePlayer),
  3427. 3 => ::std::option::Option::Some(CapabilityType::kRestrictToLocal),
  3428. 4 => ::std::option::Option::Some(CapabilityType::kDeviceType),
  3429. 5 => ::std::option::Option::Some(CapabilityType::kGaiaEqConnectId),
  3430. 6 => ::std::option::Option::Some(CapabilityType::kSupportsLogout),
  3431. 7 => ::std::option::Option::Some(CapabilityType::kIsObservable),
  3432. 8 => ::std::option::Option::Some(CapabilityType::kVolumeSteps),
  3433. 9 => ::std::option::Option::Some(CapabilityType::kSupportedTypes),
  3434. 10 => ::std::option::Option::Some(CapabilityType::kCommandAcks),
  3435. 11 => ::std::option::Option::Some(CapabilityType::kSupportsRename),
  3436. 12 => ::std::option::Option::Some(CapabilityType::kHidden),
  3437. 13 => ::std::option::Option::Some(CapabilityType::kSupportsPlaylistV2),
  3438. 14 => ::std::option::Option::Some(CapabilityType::kSupportsExternalEpisodes),
  3439. _ => ::std::option::Option::None
  3440. }
  3441. }
  3442. fn values() -> &'static [Self] {
  3443. static values: &'static [CapabilityType] = &[
  3444. CapabilityType::kSupportedContexts,
  3445. CapabilityType::kCanBePlayer,
  3446. CapabilityType::kRestrictToLocal,
  3447. CapabilityType::kDeviceType,
  3448. CapabilityType::kGaiaEqConnectId,
  3449. CapabilityType::kSupportsLogout,
  3450. CapabilityType::kIsObservable,
  3451. CapabilityType::kVolumeSteps,
  3452. CapabilityType::kSupportedTypes,
  3453. CapabilityType::kCommandAcks,
  3454. CapabilityType::kSupportsRename,
  3455. CapabilityType::kHidden,
  3456. CapabilityType::kSupportsPlaylistV2,
  3457. CapabilityType::kSupportsExternalEpisodes,
  3458. ];
  3459. values
  3460. }
  3461. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  3462. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
  3463. lock: ::protobuf::lazy::ONCE_INIT,
  3464. ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
  3465. };
  3466. unsafe {
  3467. descriptor.get(|| {
  3468. ::protobuf::reflect::EnumDescriptor::new("CapabilityType", file_descriptor_proto())
  3469. })
  3470. }
  3471. }
  3472. }
  3473. impl ::std::marker::Copy for CapabilityType {
  3474. }
  3475. // Note, `Default` is implemented although default value is not 0
  3476. impl ::std::default::Default for CapabilityType {
  3477. fn default() -> Self {
  3478. CapabilityType::kSupportedContexts
  3479. }
  3480. }
  3481. impl ::protobuf::reflect::ProtobufValue for CapabilityType {
  3482. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  3483. ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
  3484. }
  3485. }
  3486. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  3487. pub enum PlayStatus {
  3488. kPlayStatusStop = 0,
  3489. kPlayStatusPlay = 1,
  3490. kPlayStatusPause = 2,
  3491. kPlayStatusLoading = 3,
  3492. }
  3493. impl ::protobuf::ProtobufEnum for PlayStatus {
  3494. fn value(&self) -> i32 {
  3495. *self as i32
  3496. }
  3497. fn from_i32(value: i32) -> ::std::option::Option<PlayStatus> {
  3498. match value {
  3499. 0 => ::std::option::Option::Some(PlayStatus::kPlayStatusStop),
  3500. 1 => ::std::option::Option::Some(PlayStatus::kPlayStatusPlay),
  3501. 2 => ::std::option::Option::Some(PlayStatus::kPlayStatusPause),
  3502. 3 => ::std::option::Option::Some(PlayStatus::kPlayStatusLoading),
  3503. _ => ::std::option::Option::None
  3504. }
  3505. }
  3506. fn values() -> &'static [Self] {
  3507. static values: &'static [PlayStatus] = &[
  3508. PlayStatus::kPlayStatusStop,
  3509. PlayStatus::kPlayStatusPlay,
  3510. PlayStatus::kPlayStatusPause,
  3511. PlayStatus::kPlayStatusLoading,
  3512. ];
  3513. values
  3514. }
  3515. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  3516. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
  3517. lock: ::protobuf::lazy::ONCE_INIT,
  3518. ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
  3519. };
  3520. unsafe {
  3521. descriptor.get(|| {
  3522. ::protobuf::reflect::EnumDescriptor::new("PlayStatus", file_descriptor_proto())
  3523. })
  3524. }
  3525. }
  3526. }
  3527. impl ::std::marker::Copy for PlayStatus {
  3528. }
  3529. impl ::std::default::Default for PlayStatus {
  3530. fn default() -> Self {
  3531. PlayStatus::kPlayStatusStop
  3532. }
  3533. }
  3534. impl ::protobuf::reflect::ProtobufValue for PlayStatus {
  3535. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  3536. ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
  3537. }
  3538. }
  3539. static file_descriptor_proto_data: &'static [u8] = b"\
  3540. \n\x0bspirc.proto\x12\0\"\xfd\x02\n\x05Frame\x12\x11\n\x07version\x18\
  3541. \x01\x20\x01(\rB\0\x12\x0f\n\x05ident\x18\x02\x20\x01(\tB\0\x12\x1a\n\
  3542. \x10protocol_version\x18\x03\x20\x01(\tB\0\x12\x10\n\x06seq_nr\x18\x04\
  3543. \x20\x01(\rB\0\x12\x1b\n\x03typ\x18\x05\x20\x01(\x0e2\x0c.MessageTypeB\0\
  3544. \x12$\n\x0cdevice_state\x18\x07\x20\x01(\x0b2\x0c.DeviceStateB\0\x12\x1b\
  3545. \n\x07goodbye\x18\x0b\x20\x01(\x0b2\x08.GoodbyeB\0\x12\x17\n\x05state\
  3546. \x18\x0c\x20\x01(\x0b2\x06.StateB\0\x12\x12\n\x08position\x18\r\x20\x01(\
  3547. \rB\0\x12\x10\n\x06volume\x18\x0e\x20\x01(\rB\0\x12\x19\n\x0fstate_updat\
  3548. e_id\x18\x11\x20\x01(\x03B\0\x12\x13\n\trecipient\x18\x12\x20\x03(\tB\0\
  3549. \x12\x1e\n\x14context_player_state\x18\x13\x20\x01(\x0cB\0\x12\x12\n\x08\
  3550. new_name\x18\x14\x20\x01(\tB\0\x12\x1d\n\x08metadata\x18\x19\x20\x01(\
  3551. \x0b2\t.MetadataB\0:\0\"\x9f\x02\n\x0bDeviceState\x12\x14\n\nsw_version\
  3552. \x18\x01\x20\x01(\tB\0\x12\x13\n\tis_active\x18\n\x20\x01(\x08B\0\x12\
  3553. \x12\n\x08can_play\x18\x0b\x20\x01(\x08B\0\x12\x10\n\x06volume\x18\x0c\
  3554. \x20\x01(\rB\0\x12\x0e\n\x04name\x18\r\x20\x01(\tB\0\x12\x14\n\nerror_co\
  3555. de\x18\x0e\x20\x01(\rB\0\x12\x1a\n\x10became_active_at\x18\x0f\x20\x01(\
  3556. \x03B\0\x12\x17\n\rerror_message\x18\x10\x20\x01(\tB\0\x12#\n\x0ccapabil\
  3557. ities\x18\x11\x20\x03(\x0b2\x0b.CapabilityB\0\x12\x1e\n\x14context_playe\
  3558. r_error\x18\x14\x20\x01(\tB\0\x12\x1d\n\x08metadata\x18\x19\x20\x03(\x0b\
  3559. 2\t.MetadataB\0:\0\"Y\n\nCapability\x12\x1e\n\x03typ\x18\x01\x20\x01(\
  3560. \x0e2\x0f.CapabilityTypeB\0\x12\x12\n\x08intValue\x18\x02\x20\x03(\x03B\
  3561. \0\x12\x15\n\x0bstringValue\x18\x03\x20\x03(\tB\0:\0\"\x1d\n\x07Goodbye\
  3562. \x12\x10\n\x06reason\x18\x01\x20\x01(\tB\0:\0\"\x85\x03\n\x05State\x12\
  3563. \x15\n\x0bcontext_uri\x18\x02\x20\x01(\tB\0\x12\x0f\n\x05index\x18\x03\
  3564. \x20\x01(\rB\0\x12\x15\n\x0bposition_ms\x18\x04\x20\x01(\rB\0\x12\x1d\n\
  3565. \x06status\x18\x05\x20\x01(\x0e2\x0b.PlayStatusB\0\x12\x1e\n\x14position\
  3566. _measured_at\x18\x07\x20\x01(\x04B\0\x12\x1d\n\x13context_description\
  3567. \x18\x08\x20\x01(\tB\0\x12\x11\n\x07shuffle\x18\r\x20\x01(\x08B\0\x12\
  3568. \x10\n\x06repeat\x18\x0e\x20\x01(\x08B\0\x12\x1c\n\x12last_command_ident\
  3569. \x18\x14\x20\x01(\tB\0\x12\x1c\n\x12last_command_msgid\x18\x15\x20\x01(\
  3570. \rB\0\x12\x1f\n\x15playing_from_fallback\x18\x18\x20\x01(\x08B\0\x12\r\n\
  3571. \x03row\x18\x19\x20\x01(\rB\0\x12\x1d\n\x13playing_track_index\x18\x1a\
  3572. \x20\x01(\rB\0\x12\x1a\n\x05track\x18\x1b\x20\x03(\x0b2\t.TrackRefB\0\
  3573. \x12\x11\n\x02ad\x18\x1c\x20\x01(\x0b2\x03.AdB\0:\0\"O\n\x08TrackRef\x12\
  3574. \r\n\x03gid\x18\x01\x20\x01(\x0cB\0\x12\r\n\x03uri\x18\x02\x20\x01(\tB\0\
  3575. \x12\x10\n\x06queued\x18\x03\x20\x01(\x08B\0\x12\x11\n\x07context\x18\
  3576. \x04\x20\x01(\tB\0:\0\"\xb9\x01\n\x02Ad\x12\x0e\n\x04next\x18\x01\x20\
  3577. \x01(\x05B\0\x12\x11\n\x07ogg_fid\x18\x02\x20\x01(\x0cB\0\x12\x13\n\tima\
  3578. ge_fid\x18\x03\x20\x01(\x0cB\0\x12\x12\n\x08duration\x18\x04\x20\x01(\
  3579. \x05B\0\x12\x13\n\tclick_url\x18\x05\x20\x01(\tB\0\x12\x18\n\x0eimpressi\
  3580. on_url\x18\x06\x20\x01(\tB\0\x12\x11\n\x07product\x18\x07\x20\x01(\tB\0\
  3581. \x12\x14\n\nadvertiser\x18\x08\x20\x01(\tB\0\x12\r\n\x03gid\x18\t\x20\
  3582. \x01(\x0cB\0:\0\"0\n\x08Metadata\x12\x0e\n\x04type\x18\x01\x20\x01(\tB\0\
  3583. \x12\x12\n\x08metadata\x18\x02\x20\x01(\tB\0:\0*\x8f\x04\n\x0bMessageTyp\
  3584. e\x12\x15\n\x11kMessageTypeHello\x10\x01\x12\x17\n\x13kMessageTypeGoodby\
  3585. e\x10\x02\x12\x15\n\x11kMessageTypeProbe\x10\x03\x12\x16\n\x12kMessageTy\
  3586. peNotify\x10\n\x12\x14\n\x10kMessageTypeLoad\x10\x14\x12\x14\n\x10kMessa\
  3587. geTypePlay\x10\x15\x12\x15\n\x11kMessageTypePause\x10\x16\x12\x19\n\x15k\
  3588. MessageTypePlayPause\x10\x17\x12\x14\n\x10kMessageTypeSeek\x10\x18\x12\
  3589. \x14\n\x10kMessageTypePrev\x10\x19\x12\x14\n\x10kMessageTypeNext\x10\x1a\
  3590. \x12\x16\n\x12kMessageTypeVolume\x10\x1b\x12\x17\n\x13kMessageTypeShuffl\
  3591. e\x10\x1c\x12\x16\n\x12kMessageTypeRepeat\x10\x1d\x12\x1a\n\x16kMessageT\
  3592. ypeVolumeDown\x10\x1f\x12\x18\n\x14kMessageTypeVolumeUp\x10\x20\x12\x17\
  3593. \n\x13kMessageTypeReplace\x10!\x12\x16\n\x12kMessageTypeLogout\x10\"\x12\
  3594. \x16\n\x12kMessageTypeAction\x10#\x12\x16\n\x12kMessageTypeRename\x10$\
  3595. \x12\x1f\n\x1akMessageTypeUpdateMetadata\x10\x80\x01\x1a\0*\xb4\x02\n\
  3596. \x0eCapabilityType\x12\x16\n\x12kSupportedContexts\x10\x01\x12\x10\n\x0c\
  3597. kCanBePlayer\x10\x02\x12\x14\n\x10kRestrictToLocal\x10\x03\x12\x0f\n\x0b\
  3598. kDeviceType\x10\x04\x12\x14\n\x10kGaiaEqConnectId\x10\x05\x12\x13\n\x0fk\
  3599. SupportsLogout\x10\x06\x12\x11\n\rkIsObservable\x10\x07\x12\x10\n\x0ckVo\
  3600. lumeSteps\x10\x08\x12\x13\n\x0fkSupportedTypes\x10\t\x12\x10\n\x0ckComma\
  3601. ndAcks\x10\n\x12\x13\n\x0fkSupportsRename\x10\x0b\x12\x0b\n\x07kHidden\
  3602. \x10\x0c\x12\x17\n\x13kSupportsPlaylistV2\x10\r\x12\x1d\n\x19kSupportsEx\
  3603. ternalEpisodes\x10\x0e\x1a\0*f\n\nPlayStatus\x12\x13\n\x0fkPlayStatusSto\
  3604. p\x10\0\x12\x13\n\x0fkPlayStatusPlay\x10\x01\x12\x14\n\x10kPlayStatusPau\
  3605. se\x10\x02\x12\x16\n\x12kPlayStatusLoading\x10\x03\x1a\0B\0b\x06proto2\
  3606. ";
  3607. static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
  3608. lock: ::protobuf::lazy::ONCE_INIT,
  3609. ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
  3610. };
  3611. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  3612. ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
  3613. }
  3614. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  3615. unsafe {
  3616. file_descriptor_proto_lazy.get(|| {
  3617. parse_descriptor_proto()
  3618. })
  3619. }
  3620. }