keyexchange.rs 231 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822
  1. // This file is generated by rust-protobuf 2.0.5. Do not edit
  2. // @generated
  3. // https://github.com/Manishearth/rust-clippy/issues/702
  4. #![allow(unknown_lints)]
  5. #![allow(clippy)]
  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. use protobuf::Message as Message_imported_for_functions;
  18. use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
  19. #[derive(PartialEq,Clone,Default)]
  20. pub struct ClientHello {
  21. // message fields
  22. build_info: ::protobuf::SingularPtrField<BuildInfo>,
  23. fingerprints_supported: ::std::vec::Vec<Fingerprint>,
  24. cryptosuites_supported: ::std::vec::Vec<Cryptosuite>,
  25. powschemes_supported: ::std::vec::Vec<Powscheme>,
  26. login_crypto_hello: ::protobuf::SingularPtrField<LoginCryptoHelloUnion>,
  27. client_nonce: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  28. padding: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  29. feature_set: ::protobuf::SingularPtrField<FeatureSet>,
  30. // special fields
  31. unknown_fields: ::protobuf::UnknownFields,
  32. cached_size: ::protobuf::CachedSize,
  33. }
  34. impl ClientHello {
  35. pub fn new() -> ClientHello {
  36. ::std::default::Default::default()
  37. }
  38. // required .BuildInfo build_info = 10;
  39. pub fn clear_build_info(&mut self) {
  40. self.build_info.clear();
  41. }
  42. pub fn has_build_info(&self) -> bool {
  43. self.build_info.is_some()
  44. }
  45. // Param is passed by value, moved
  46. pub fn set_build_info(&mut self, v: BuildInfo) {
  47. self.build_info = ::protobuf::SingularPtrField::some(v);
  48. }
  49. // Mutable pointer to the field.
  50. // If field is not initialized, it is initialized with default value first.
  51. pub fn mut_build_info(&mut self) -> &mut BuildInfo {
  52. if self.build_info.is_none() {
  53. self.build_info.set_default();
  54. }
  55. self.build_info.as_mut().unwrap()
  56. }
  57. // Take field
  58. pub fn take_build_info(&mut self) -> BuildInfo {
  59. self.build_info.take().unwrap_or_else(|| BuildInfo::new())
  60. }
  61. pub fn get_build_info(&self) -> &BuildInfo {
  62. self.build_info.as_ref().unwrap_or_else(|| BuildInfo::default_instance())
  63. }
  64. // repeated .Fingerprint fingerprints_supported = 20;
  65. pub fn clear_fingerprints_supported(&mut self) {
  66. self.fingerprints_supported.clear();
  67. }
  68. // Param is passed by value, moved
  69. pub fn set_fingerprints_supported(&mut self, v: ::std::vec::Vec<Fingerprint>) {
  70. self.fingerprints_supported = v;
  71. }
  72. // Mutable pointer to the field.
  73. pub fn mut_fingerprints_supported(&mut self) -> &mut ::std::vec::Vec<Fingerprint> {
  74. &mut self.fingerprints_supported
  75. }
  76. // Take field
  77. pub fn take_fingerprints_supported(&mut self) -> ::std::vec::Vec<Fingerprint> {
  78. ::std::mem::replace(&mut self.fingerprints_supported, ::std::vec::Vec::new())
  79. }
  80. pub fn get_fingerprints_supported(&self) -> &[Fingerprint] {
  81. &self.fingerprints_supported
  82. }
  83. // repeated .Cryptosuite cryptosuites_supported = 30;
  84. pub fn clear_cryptosuites_supported(&mut self) {
  85. self.cryptosuites_supported.clear();
  86. }
  87. // Param is passed by value, moved
  88. pub fn set_cryptosuites_supported(&mut self, v: ::std::vec::Vec<Cryptosuite>) {
  89. self.cryptosuites_supported = v;
  90. }
  91. // Mutable pointer to the field.
  92. pub fn mut_cryptosuites_supported(&mut self) -> &mut ::std::vec::Vec<Cryptosuite> {
  93. &mut self.cryptosuites_supported
  94. }
  95. // Take field
  96. pub fn take_cryptosuites_supported(&mut self) -> ::std::vec::Vec<Cryptosuite> {
  97. ::std::mem::replace(&mut self.cryptosuites_supported, ::std::vec::Vec::new())
  98. }
  99. pub fn get_cryptosuites_supported(&self) -> &[Cryptosuite] {
  100. &self.cryptosuites_supported
  101. }
  102. // repeated .Powscheme powschemes_supported = 40;
  103. pub fn clear_powschemes_supported(&mut self) {
  104. self.powschemes_supported.clear();
  105. }
  106. // Param is passed by value, moved
  107. pub fn set_powschemes_supported(&mut self, v: ::std::vec::Vec<Powscheme>) {
  108. self.powschemes_supported = v;
  109. }
  110. // Mutable pointer to the field.
  111. pub fn mut_powschemes_supported(&mut self) -> &mut ::std::vec::Vec<Powscheme> {
  112. &mut self.powschemes_supported
  113. }
  114. // Take field
  115. pub fn take_powschemes_supported(&mut self) -> ::std::vec::Vec<Powscheme> {
  116. ::std::mem::replace(&mut self.powschemes_supported, ::std::vec::Vec::new())
  117. }
  118. pub fn get_powschemes_supported(&self) -> &[Powscheme] {
  119. &self.powschemes_supported
  120. }
  121. // required .LoginCryptoHelloUnion login_crypto_hello = 50;
  122. pub fn clear_login_crypto_hello(&mut self) {
  123. self.login_crypto_hello.clear();
  124. }
  125. pub fn has_login_crypto_hello(&self) -> bool {
  126. self.login_crypto_hello.is_some()
  127. }
  128. // Param is passed by value, moved
  129. pub fn set_login_crypto_hello(&mut self, v: LoginCryptoHelloUnion) {
  130. self.login_crypto_hello = ::protobuf::SingularPtrField::some(v);
  131. }
  132. // Mutable pointer to the field.
  133. // If field is not initialized, it is initialized with default value first.
  134. pub fn mut_login_crypto_hello(&mut self) -> &mut LoginCryptoHelloUnion {
  135. if self.login_crypto_hello.is_none() {
  136. self.login_crypto_hello.set_default();
  137. }
  138. self.login_crypto_hello.as_mut().unwrap()
  139. }
  140. // Take field
  141. pub fn take_login_crypto_hello(&mut self) -> LoginCryptoHelloUnion {
  142. self.login_crypto_hello.take().unwrap_or_else(|| LoginCryptoHelloUnion::new())
  143. }
  144. pub fn get_login_crypto_hello(&self) -> &LoginCryptoHelloUnion {
  145. self.login_crypto_hello.as_ref().unwrap_or_else(|| LoginCryptoHelloUnion::default_instance())
  146. }
  147. // required bytes client_nonce = 60;
  148. pub fn clear_client_nonce(&mut self) {
  149. self.client_nonce.clear();
  150. }
  151. pub fn has_client_nonce(&self) -> bool {
  152. self.client_nonce.is_some()
  153. }
  154. // Param is passed by value, moved
  155. pub fn set_client_nonce(&mut self, v: ::std::vec::Vec<u8>) {
  156. self.client_nonce = ::protobuf::SingularField::some(v);
  157. }
  158. // Mutable pointer to the field.
  159. // If field is not initialized, it is initialized with default value first.
  160. pub fn mut_client_nonce(&mut self) -> &mut ::std::vec::Vec<u8> {
  161. if self.client_nonce.is_none() {
  162. self.client_nonce.set_default();
  163. }
  164. self.client_nonce.as_mut().unwrap()
  165. }
  166. // Take field
  167. pub fn take_client_nonce(&mut self) -> ::std::vec::Vec<u8> {
  168. self.client_nonce.take().unwrap_or_else(|| ::std::vec::Vec::new())
  169. }
  170. pub fn get_client_nonce(&self) -> &[u8] {
  171. match self.client_nonce.as_ref() {
  172. Some(v) => &v,
  173. None => &[],
  174. }
  175. }
  176. // optional bytes padding = 70;
  177. pub fn clear_padding(&mut self) {
  178. self.padding.clear();
  179. }
  180. pub fn has_padding(&self) -> bool {
  181. self.padding.is_some()
  182. }
  183. // Param is passed by value, moved
  184. pub fn set_padding(&mut self, v: ::std::vec::Vec<u8>) {
  185. self.padding = ::protobuf::SingularField::some(v);
  186. }
  187. // Mutable pointer to the field.
  188. // If field is not initialized, it is initialized with default value first.
  189. pub fn mut_padding(&mut self) -> &mut ::std::vec::Vec<u8> {
  190. if self.padding.is_none() {
  191. self.padding.set_default();
  192. }
  193. self.padding.as_mut().unwrap()
  194. }
  195. // Take field
  196. pub fn take_padding(&mut self) -> ::std::vec::Vec<u8> {
  197. self.padding.take().unwrap_or_else(|| ::std::vec::Vec::new())
  198. }
  199. pub fn get_padding(&self) -> &[u8] {
  200. match self.padding.as_ref() {
  201. Some(v) => &v,
  202. None => &[],
  203. }
  204. }
  205. // optional .FeatureSet feature_set = 80;
  206. pub fn clear_feature_set(&mut self) {
  207. self.feature_set.clear();
  208. }
  209. pub fn has_feature_set(&self) -> bool {
  210. self.feature_set.is_some()
  211. }
  212. // Param is passed by value, moved
  213. pub fn set_feature_set(&mut self, v: FeatureSet) {
  214. self.feature_set = ::protobuf::SingularPtrField::some(v);
  215. }
  216. // Mutable pointer to the field.
  217. // If field is not initialized, it is initialized with default value first.
  218. pub fn mut_feature_set(&mut self) -> &mut FeatureSet {
  219. if self.feature_set.is_none() {
  220. self.feature_set.set_default();
  221. }
  222. self.feature_set.as_mut().unwrap()
  223. }
  224. // Take field
  225. pub fn take_feature_set(&mut self) -> FeatureSet {
  226. self.feature_set.take().unwrap_or_else(|| FeatureSet::new())
  227. }
  228. pub fn get_feature_set(&self) -> &FeatureSet {
  229. self.feature_set.as_ref().unwrap_or_else(|| FeatureSet::default_instance())
  230. }
  231. }
  232. impl ::protobuf::Message for ClientHello {
  233. fn is_initialized(&self) -> bool {
  234. if self.build_info.is_none() {
  235. return false;
  236. }
  237. if self.login_crypto_hello.is_none() {
  238. return false;
  239. }
  240. if self.client_nonce.is_none() {
  241. return false;
  242. }
  243. for v in &self.build_info {
  244. if !v.is_initialized() {
  245. return false;
  246. }
  247. };
  248. for v in &self.login_crypto_hello {
  249. if !v.is_initialized() {
  250. return false;
  251. }
  252. };
  253. for v in &self.feature_set {
  254. if !v.is_initialized() {
  255. return false;
  256. }
  257. };
  258. true
  259. }
  260. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  261. while !is.eof()? {
  262. let (field_number, wire_type) = is.read_tag_unpack()?;
  263. match field_number {
  264. 10 => {
  265. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.build_info)?;
  266. },
  267. 20 => {
  268. ::protobuf::rt::read_repeated_enum_with_unknown_fields_into(wire_type, is, &mut self.fingerprints_supported, 20, &mut self.unknown_fields)?
  269. },
  270. 30 => {
  271. ::protobuf::rt::read_repeated_enum_with_unknown_fields_into(wire_type, is, &mut self.cryptosuites_supported, 30, &mut self.unknown_fields)?
  272. },
  273. 40 => {
  274. ::protobuf::rt::read_repeated_enum_with_unknown_fields_into(wire_type, is, &mut self.powschemes_supported, 40, &mut self.unknown_fields)?
  275. },
  276. 50 => {
  277. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_crypto_hello)?;
  278. },
  279. 60 => {
  280. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.client_nonce)?;
  281. },
  282. 70 => {
  283. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.padding)?;
  284. },
  285. 80 => {
  286. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.feature_set)?;
  287. },
  288. _ => {
  289. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  290. },
  291. };
  292. }
  293. ::std::result::Result::Ok(())
  294. }
  295. // Compute sizes of nested messages
  296. #[allow(unused_variables)]
  297. fn compute_size(&self) -> u32 {
  298. let mut my_size = 0;
  299. if let Some(ref v) = self.build_info.as_ref() {
  300. let len = v.compute_size();
  301. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  302. }
  303. for value in &self.fingerprints_supported {
  304. my_size += ::protobuf::rt::enum_size(20, *value);
  305. };
  306. for value in &self.cryptosuites_supported {
  307. my_size += ::protobuf::rt::enum_size(30, *value);
  308. };
  309. for value in &self.powschemes_supported {
  310. my_size += ::protobuf::rt::enum_size(40, *value);
  311. };
  312. if let Some(ref v) = self.login_crypto_hello.as_ref() {
  313. let len = v.compute_size();
  314. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  315. }
  316. if let Some(ref v) = self.client_nonce.as_ref() {
  317. my_size += ::protobuf::rt::bytes_size(60, &v);
  318. }
  319. if let Some(ref v) = self.padding.as_ref() {
  320. my_size += ::protobuf::rt::bytes_size(70, &v);
  321. }
  322. if let Some(ref v) = self.feature_set.as_ref() {
  323. let len = v.compute_size();
  324. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  325. }
  326. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  327. self.cached_size.set(my_size);
  328. my_size
  329. }
  330. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  331. if let Some(ref v) = self.build_info.as_ref() {
  332. os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  333. os.write_raw_varint32(v.get_cached_size())?;
  334. v.write_to_with_cached_sizes(os)?;
  335. }
  336. for v in &self.fingerprints_supported {
  337. os.write_enum(20, v.value())?;
  338. };
  339. for v in &self.cryptosuites_supported {
  340. os.write_enum(30, v.value())?;
  341. };
  342. for v in &self.powschemes_supported {
  343. os.write_enum(40, v.value())?;
  344. };
  345. if let Some(ref v) = self.login_crypto_hello.as_ref() {
  346. os.write_tag(50, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  347. os.write_raw_varint32(v.get_cached_size())?;
  348. v.write_to_with_cached_sizes(os)?;
  349. }
  350. if let Some(ref v) = self.client_nonce.as_ref() {
  351. os.write_bytes(60, &v)?;
  352. }
  353. if let Some(ref v) = self.padding.as_ref() {
  354. os.write_bytes(70, &v)?;
  355. }
  356. if let Some(ref v) = self.feature_set.as_ref() {
  357. os.write_tag(80, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  358. os.write_raw_varint32(v.get_cached_size())?;
  359. v.write_to_with_cached_sizes(os)?;
  360. }
  361. os.write_unknown_fields(self.get_unknown_fields())?;
  362. ::std::result::Result::Ok(())
  363. }
  364. fn get_cached_size(&self) -> u32 {
  365. self.cached_size.get()
  366. }
  367. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  368. &self.unknown_fields
  369. }
  370. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  371. &mut self.unknown_fields
  372. }
  373. fn as_any(&self) -> &::std::any::Any {
  374. self as &::std::any::Any
  375. }
  376. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  377. self as &mut ::std::any::Any
  378. }
  379. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  380. self
  381. }
  382. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  383. Self::descriptor_static()
  384. }
  385. fn new() -> ClientHello {
  386. ClientHello::new()
  387. }
  388. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  389. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  390. lock: ::protobuf::lazy::ONCE_INIT,
  391. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  392. };
  393. unsafe {
  394. descriptor.get(|| {
  395. let mut fields = ::std::vec::Vec::new();
  396. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<BuildInfo>>(
  397. "build_info",
  398. |m: &ClientHello| { &m.build_info },
  399. |m: &mut ClientHello| { &mut m.build_info },
  400. ));
  401. fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum<Fingerprint>>(
  402. "fingerprints_supported",
  403. |m: &ClientHello| { &m.fingerprints_supported },
  404. |m: &mut ClientHello| { &mut m.fingerprints_supported },
  405. ));
  406. fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum<Cryptosuite>>(
  407. "cryptosuites_supported",
  408. |m: &ClientHello| { &m.cryptosuites_supported },
  409. |m: &mut ClientHello| { &mut m.cryptosuites_supported },
  410. ));
  411. fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum<Powscheme>>(
  412. "powschemes_supported",
  413. |m: &ClientHello| { &m.powschemes_supported },
  414. |m: &mut ClientHello| { &mut m.powschemes_supported },
  415. ));
  416. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<LoginCryptoHelloUnion>>(
  417. "login_crypto_hello",
  418. |m: &ClientHello| { &m.login_crypto_hello },
  419. |m: &mut ClientHello| { &mut m.login_crypto_hello },
  420. ));
  421. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  422. "client_nonce",
  423. |m: &ClientHello| { &m.client_nonce },
  424. |m: &mut ClientHello| { &mut m.client_nonce },
  425. ));
  426. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  427. "padding",
  428. |m: &ClientHello| { &m.padding },
  429. |m: &mut ClientHello| { &mut m.padding },
  430. ));
  431. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<FeatureSet>>(
  432. "feature_set",
  433. |m: &ClientHello| { &m.feature_set },
  434. |m: &mut ClientHello| { &mut m.feature_set },
  435. ));
  436. ::protobuf::reflect::MessageDescriptor::new::<ClientHello>(
  437. "ClientHello",
  438. fields,
  439. file_descriptor_proto()
  440. )
  441. })
  442. }
  443. }
  444. fn default_instance() -> &'static ClientHello {
  445. static mut instance: ::protobuf::lazy::Lazy<ClientHello> = ::protobuf::lazy::Lazy {
  446. lock: ::protobuf::lazy::ONCE_INIT,
  447. ptr: 0 as *const ClientHello,
  448. };
  449. unsafe {
  450. instance.get(ClientHello::new)
  451. }
  452. }
  453. }
  454. impl ::protobuf::Clear for ClientHello {
  455. fn clear(&mut self) {
  456. self.clear_build_info();
  457. self.clear_fingerprints_supported();
  458. self.clear_cryptosuites_supported();
  459. self.clear_powschemes_supported();
  460. self.clear_login_crypto_hello();
  461. self.clear_client_nonce();
  462. self.clear_padding();
  463. self.clear_feature_set();
  464. self.unknown_fields.clear();
  465. }
  466. }
  467. impl ::std::fmt::Debug for ClientHello {
  468. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  469. ::protobuf::text_format::fmt(self, f)
  470. }
  471. }
  472. impl ::protobuf::reflect::ProtobufValue for ClientHello {
  473. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  474. ::protobuf::reflect::ProtobufValueRef::Message(self)
  475. }
  476. }
  477. #[derive(PartialEq,Clone,Default)]
  478. pub struct BuildInfo {
  479. // message fields
  480. product: ::std::option::Option<Product>,
  481. product_flags: ::std::vec::Vec<ProductFlags>,
  482. platform: ::std::option::Option<Platform>,
  483. version: ::std::option::Option<u64>,
  484. // special fields
  485. unknown_fields: ::protobuf::UnknownFields,
  486. cached_size: ::protobuf::CachedSize,
  487. }
  488. impl BuildInfo {
  489. pub fn new() -> BuildInfo {
  490. ::std::default::Default::default()
  491. }
  492. // required .Product product = 10;
  493. pub fn clear_product(&mut self) {
  494. self.product = ::std::option::Option::None;
  495. }
  496. pub fn has_product(&self) -> bool {
  497. self.product.is_some()
  498. }
  499. // Param is passed by value, moved
  500. pub fn set_product(&mut self, v: Product) {
  501. self.product = ::std::option::Option::Some(v);
  502. }
  503. pub fn get_product(&self) -> Product {
  504. self.product.unwrap_or(Product::PRODUCT_CLIENT)
  505. }
  506. // repeated .ProductFlags product_flags = 20;
  507. pub fn clear_product_flags(&mut self) {
  508. self.product_flags.clear();
  509. }
  510. // Param is passed by value, moved
  511. pub fn set_product_flags(&mut self, v: ::std::vec::Vec<ProductFlags>) {
  512. self.product_flags = v;
  513. }
  514. // Mutable pointer to the field.
  515. pub fn mut_product_flags(&mut self) -> &mut ::std::vec::Vec<ProductFlags> {
  516. &mut self.product_flags
  517. }
  518. // Take field
  519. pub fn take_product_flags(&mut self) -> ::std::vec::Vec<ProductFlags> {
  520. ::std::mem::replace(&mut self.product_flags, ::std::vec::Vec::new())
  521. }
  522. pub fn get_product_flags(&self) -> &[ProductFlags] {
  523. &self.product_flags
  524. }
  525. // required .Platform platform = 30;
  526. pub fn clear_platform(&mut self) {
  527. self.platform = ::std::option::Option::None;
  528. }
  529. pub fn has_platform(&self) -> bool {
  530. self.platform.is_some()
  531. }
  532. // Param is passed by value, moved
  533. pub fn set_platform(&mut self, v: Platform) {
  534. self.platform = ::std::option::Option::Some(v);
  535. }
  536. pub fn get_platform(&self) -> Platform {
  537. self.platform.unwrap_or(Platform::PLATFORM_WIN32_X86)
  538. }
  539. // required uint64 version = 40;
  540. pub fn clear_version(&mut self) {
  541. self.version = ::std::option::Option::None;
  542. }
  543. pub fn has_version(&self) -> bool {
  544. self.version.is_some()
  545. }
  546. // Param is passed by value, moved
  547. pub fn set_version(&mut self, v: u64) {
  548. self.version = ::std::option::Option::Some(v);
  549. }
  550. pub fn get_version(&self) -> u64 {
  551. self.version.unwrap_or(0)
  552. }
  553. }
  554. impl ::protobuf::Message for BuildInfo {
  555. fn is_initialized(&self) -> bool {
  556. if self.product.is_none() {
  557. return false;
  558. }
  559. if self.platform.is_none() {
  560. return false;
  561. }
  562. if self.version.is_none() {
  563. return false;
  564. }
  565. true
  566. }
  567. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  568. while !is.eof()? {
  569. let (field_number, wire_type) = is.read_tag_unpack()?;
  570. match field_number {
  571. 10 => {
  572. ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.product, 10, &mut self.unknown_fields)?
  573. },
  574. 20 => {
  575. ::protobuf::rt::read_repeated_enum_with_unknown_fields_into(wire_type, is, &mut self.product_flags, 20, &mut self.unknown_fields)?
  576. },
  577. 30 => {
  578. ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.platform, 30, &mut self.unknown_fields)?
  579. },
  580. 40 => {
  581. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  582. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  583. }
  584. let tmp = is.read_uint64()?;
  585. self.version = ::std::option::Option::Some(tmp);
  586. },
  587. _ => {
  588. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  589. },
  590. };
  591. }
  592. ::std::result::Result::Ok(())
  593. }
  594. // Compute sizes of nested messages
  595. #[allow(unused_variables)]
  596. fn compute_size(&self) -> u32 {
  597. let mut my_size = 0;
  598. if let Some(v) = self.product {
  599. my_size += ::protobuf::rt::enum_size(10, v);
  600. }
  601. for value in &self.product_flags {
  602. my_size += ::protobuf::rt::enum_size(20, *value);
  603. };
  604. if let Some(v) = self.platform {
  605. my_size += ::protobuf::rt::enum_size(30, v);
  606. }
  607. if let Some(v) = self.version {
  608. my_size += ::protobuf::rt::value_size(40, v, ::protobuf::wire_format::WireTypeVarint);
  609. }
  610. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  611. self.cached_size.set(my_size);
  612. my_size
  613. }
  614. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  615. if let Some(v) = self.product {
  616. os.write_enum(10, v.value())?;
  617. }
  618. for v in &self.product_flags {
  619. os.write_enum(20, v.value())?;
  620. };
  621. if let Some(v) = self.platform {
  622. os.write_enum(30, v.value())?;
  623. }
  624. if let Some(v) = self.version {
  625. os.write_uint64(40, v)?;
  626. }
  627. os.write_unknown_fields(self.get_unknown_fields())?;
  628. ::std::result::Result::Ok(())
  629. }
  630. fn get_cached_size(&self) -> u32 {
  631. self.cached_size.get()
  632. }
  633. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  634. &self.unknown_fields
  635. }
  636. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  637. &mut self.unknown_fields
  638. }
  639. fn as_any(&self) -> &::std::any::Any {
  640. self as &::std::any::Any
  641. }
  642. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  643. self as &mut ::std::any::Any
  644. }
  645. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  646. self
  647. }
  648. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  649. Self::descriptor_static()
  650. }
  651. fn new() -> BuildInfo {
  652. BuildInfo::new()
  653. }
  654. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  655. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  656. lock: ::protobuf::lazy::ONCE_INIT,
  657. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  658. };
  659. unsafe {
  660. descriptor.get(|| {
  661. let mut fields = ::std::vec::Vec::new();
  662. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum<Product>>(
  663. "product",
  664. |m: &BuildInfo| { &m.product },
  665. |m: &mut BuildInfo| { &mut m.product },
  666. ));
  667. fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ProductFlags>>(
  668. "product_flags",
  669. |m: &BuildInfo| { &m.product_flags },
  670. |m: &mut BuildInfo| { &mut m.product_flags },
  671. ));
  672. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum<Platform>>(
  673. "platform",
  674. |m: &BuildInfo| { &m.platform },
  675. |m: &mut BuildInfo| { &mut m.platform },
  676. ));
  677. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
  678. "version",
  679. |m: &BuildInfo| { &m.version },
  680. |m: &mut BuildInfo| { &mut m.version },
  681. ));
  682. ::protobuf::reflect::MessageDescriptor::new::<BuildInfo>(
  683. "BuildInfo",
  684. fields,
  685. file_descriptor_proto()
  686. )
  687. })
  688. }
  689. }
  690. fn default_instance() -> &'static BuildInfo {
  691. static mut instance: ::protobuf::lazy::Lazy<BuildInfo> = ::protobuf::lazy::Lazy {
  692. lock: ::protobuf::lazy::ONCE_INIT,
  693. ptr: 0 as *const BuildInfo,
  694. };
  695. unsafe {
  696. instance.get(BuildInfo::new)
  697. }
  698. }
  699. }
  700. impl ::protobuf::Clear for BuildInfo {
  701. fn clear(&mut self) {
  702. self.clear_product();
  703. self.clear_product_flags();
  704. self.clear_platform();
  705. self.clear_version();
  706. self.unknown_fields.clear();
  707. }
  708. }
  709. impl ::std::fmt::Debug for BuildInfo {
  710. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  711. ::protobuf::text_format::fmt(self, f)
  712. }
  713. }
  714. impl ::protobuf::reflect::ProtobufValue for BuildInfo {
  715. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  716. ::protobuf::reflect::ProtobufValueRef::Message(self)
  717. }
  718. }
  719. #[derive(PartialEq,Clone,Default)]
  720. pub struct LoginCryptoHelloUnion {
  721. // message fields
  722. diffie_hellman: ::protobuf::SingularPtrField<LoginCryptoDiffieHellmanHello>,
  723. // special fields
  724. unknown_fields: ::protobuf::UnknownFields,
  725. cached_size: ::protobuf::CachedSize,
  726. }
  727. impl LoginCryptoHelloUnion {
  728. pub fn new() -> LoginCryptoHelloUnion {
  729. ::std::default::Default::default()
  730. }
  731. // optional .LoginCryptoDiffieHellmanHello diffie_hellman = 10;
  732. pub fn clear_diffie_hellman(&mut self) {
  733. self.diffie_hellman.clear();
  734. }
  735. pub fn has_diffie_hellman(&self) -> bool {
  736. self.diffie_hellman.is_some()
  737. }
  738. // Param is passed by value, moved
  739. pub fn set_diffie_hellman(&mut self, v: LoginCryptoDiffieHellmanHello) {
  740. self.diffie_hellman = ::protobuf::SingularPtrField::some(v);
  741. }
  742. // Mutable pointer to the field.
  743. // If field is not initialized, it is initialized with default value first.
  744. pub fn mut_diffie_hellman(&mut self) -> &mut LoginCryptoDiffieHellmanHello {
  745. if self.diffie_hellman.is_none() {
  746. self.diffie_hellman.set_default();
  747. }
  748. self.diffie_hellman.as_mut().unwrap()
  749. }
  750. // Take field
  751. pub fn take_diffie_hellman(&mut self) -> LoginCryptoDiffieHellmanHello {
  752. self.diffie_hellman.take().unwrap_or_else(|| LoginCryptoDiffieHellmanHello::new())
  753. }
  754. pub fn get_diffie_hellman(&self) -> &LoginCryptoDiffieHellmanHello {
  755. self.diffie_hellman.as_ref().unwrap_or_else(|| LoginCryptoDiffieHellmanHello::default_instance())
  756. }
  757. }
  758. impl ::protobuf::Message for LoginCryptoHelloUnion {
  759. fn is_initialized(&self) -> bool {
  760. for v in &self.diffie_hellman {
  761. if !v.is_initialized() {
  762. return false;
  763. }
  764. };
  765. true
  766. }
  767. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  768. while !is.eof()? {
  769. let (field_number, wire_type) = is.read_tag_unpack()?;
  770. match field_number {
  771. 10 => {
  772. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.diffie_hellman)?;
  773. },
  774. _ => {
  775. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  776. },
  777. };
  778. }
  779. ::std::result::Result::Ok(())
  780. }
  781. // Compute sizes of nested messages
  782. #[allow(unused_variables)]
  783. fn compute_size(&self) -> u32 {
  784. let mut my_size = 0;
  785. if let Some(ref v) = self.diffie_hellman.as_ref() {
  786. let len = v.compute_size();
  787. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  788. }
  789. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  790. self.cached_size.set(my_size);
  791. my_size
  792. }
  793. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  794. if let Some(ref v) = self.diffie_hellman.as_ref() {
  795. os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  796. os.write_raw_varint32(v.get_cached_size())?;
  797. v.write_to_with_cached_sizes(os)?;
  798. }
  799. os.write_unknown_fields(self.get_unknown_fields())?;
  800. ::std::result::Result::Ok(())
  801. }
  802. fn get_cached_size(&self) -> u32 {
  803. self.cached_size.get()
  804. }
  805. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  806. &self.unknown_fields
  807. }
  808. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  809. &mut self.unknown_fields
  810. }
  811. fn as_any(&self) -> &::std::any::Any {
  812. self as &::std::any::Any
  813. }
  814. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  815. self as &mut ::std::any::Any
  816. }
  817. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  818. self
  819. }
  820. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  821. Self::descriptor_static()
  822. }
  823. fn new() -> LoginCryptoHelloUnion {
  824. LoginCryptoHelloUnion::new()
  825. }
  826. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  827. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  828. lock: ::protobuf::lazy::ONCE_INIT,
  829. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  830. };
  831. unsafe {
  832. descriptor.get(|| {
  833. let mut fields = ::std::vec::Vec::new();
  834. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<LoginCryptoDiffieHellmanHello>>(
  835. "diffie_hellman",
  836. |m: &LoginCryptoHelloUnion| { &m.diffie_hellman },
  837. |m: &mut LoginCryptoHelloUnion| { &mut m.diffie_hellman },
  838. ));
  839. ::protobuf::reflect::MessageDescriptor::new::<LoginCryptoHelloUnion>(
  840. "LoginCryptoHelloUnion",
  841. fields,
  842. file_descriptor_proto()
  843. )
  844. })
  845. }
  846. }
  847. fn default_instance() -> &'static LoginCryptoHelloUnion {
  848. static mut instance: ::protobuf::lazy::Lazy<LoginCryptoHelloUnion> = ::protobuf::lazy::Lazy {
  849. lock: ::protobuf::lazy::ONCE_INIT,
  850. ptr: 0 as *const LoginCryptoHelloUnion,
  851. };
  852. unsafe {
  853. instance.get(LoginCryptoHelloUnion::new)
  854. }
  855. }
  856. }
  857. impl ::protobuf::Clear for LoginCryptoHelloUnion {
  858. fn clear(&mut self) {
  859. self.clear_diffie_hellman();
  860. self.unknown_fields.clear();
  861. }
  862. }
  863. impl ::std::fmt::Debug for LoginCryptoHelloUnion {
  864. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  865. ::protobuf::text_format::fmt(self, f)
  866. }
  867. }
  868. impl ::protobuf::reflect::ProtobufValue for LoginCryptoHelloUnion {
  869. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  870. ::protobuf::reflect::ProtobufValueRef::Message(self)
  871. }
  872. }
  873. #[derive(PartialEq,Clone,Default)]
  874. pub struct LoginCryptoDiffieHellmanHello {
  875. // message fields
  876. gc: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  877. server_keys_known: ::std::option::Option<u32>,
  878. // special fields
  879. unknown_fields: ::protobuf::UnknownFields,
  880. cached_size: ::protobuf::CachedSize,
  881. }
  882. impl LoginCryptoDiffieHellmanHello {
  883. pub fn new() -> LoginCryptoDiffieHellmanHello {
  884. ::std::default::Default::default()
  885. }
  886. // required bytes gc = 10;
  887. pub fn clear_gc(&mut self) {
  888. self.gc.clear();
  889. }
  890. pub fn has_gc(&self) -> bool {
  891. self.gc.is_some()
  892. }
  893. // Param is passed by value, moved
  894. pub fn set_gc(&mut self, v: ::std::vec::Vec<u8>) {
  895. self.gc = ::protobuf::SingularField::some(v);
  896. }
  897. // Mutable pointer to the field.
  898. // If field is not initialized, it is initialized with default value first.
  899. pub fn mut_gc(&mut self) -> &mut ::std::vec::Vec<u8> {
  900. if self.gc.is_none() {
  901. self.gc.set_default();
  902. }
  903. self.gc.as_mut().unwrap()
  904. }
  905. // Take field
  906. pub fn take_gc(&mut self) -> ::std::vec::Vec<u8> {
  907. self.gc.take().unwrap_or_else(|| ::std::vec::Vec::new())
  908. }
  909. pub fn get_gc(&self) -> &[u8] {
  910. match self.gc.as_ref() {
  911. Some(v) => &v,
  912. None => &[],
  913. }
  914. }
  915. // required uint32 server_keys_known = 20;
  916. pub fn clear_server_keys_known(&mut self) {
  917. self.server_keys_known = ::std::option::Option::None;
  918. }
  919. pub fn has_server_keys_known(&self) -> bool {
  920. self.server_keys_known.is_some()
  921. }
  922. // Param is passed by value, moved
  923. pub fn set_server_keys_known(&mut self, v: u32) {
  924. self.server_keys_known = ::std::option::Option::Some(v);
  925. }
  926. pub fn get_server_keys_known(&self) -> u32 {
  927. self.server_keys_known.unwrap_or(0)
  928. }
  929. }
  930. impl ::protobuf::Message for LoginCryptoDiffieHellmanHello {
  931. fn is_initialized(&self) -> bool {
  932. if self.gc.is_none() {
  933. return false;
  934. }
  935. if self.server_keys_known.is_none() {
  936. return false;
  937. }
  938. true
  939. }
  940. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  941. while !is.eof()? {
  942. let (field_number, wire_type) = is.read_tag_unpack()?;
  943. match field_number {
  944. 10 => {
  945. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gc)?;
  946. },
  947. 20 => {
  948. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  949. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  950. }
  951. let tmp = is.read_uint32()?;
  952. self.server_keys_known = ::std::option::Option::Some(tmp);
  953. },
  954. _ => {
  955. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  956. },
  957. };
  958. }
  959. ::std::result::Result::Ok(())
  960. }
  961. // Compute sizes of nested messages
  962. #[allow(unused_variables)]
  963. fn compute_size(&self) -> u32 {
  964. let mut my_size = 0;
  965. if let Some(ref v) = self.gc.as_ref() {
  966. my_size += ::protobuf::rt::bytes_size(10, &v);
  967. }
  968. if let Some(v) = self.server_keys_known {
  969. my_size += ::protobuf::rt::value_size(20, v, ::protobuf::wire_format::WireTypeVarint);
  970. }
  971. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  972. self.cached_size.set(my_size);
  973. my_size
  974. }
  975. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  976. if let Some(ref v) = self.gc.as_ref() {
  977. os.write_bytes(10, &v)?;
  978. }
  979. if let Some(v) = self.server_keys_known {
  980. os.write_uint32(20, v)?;
  981. }
  982. os.write_unknown_fields(self.get_unknown_fields())?;
  983. ::std::result::Result::Ok(())
  984. }
  985. fn get_cached_size(&self) -> u32 {
  986. self.cached_size.get()
  987. }
  988. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  989. &self.unknown_fields
  990. }
  991. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  992. &mut self.unknown_fields
  993. }
  994. fn as_any(&self) -> &::std::any::Any {
  995. self as &::std::any::Any
  996. }
  997. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  998. self as &mut ::std::any::Any
  999. }
  1000. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  1001. self
  1002. }
  1003. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1004. Self::descriptor_static()
  1005. }
  1006. fn new() -> LoginCryptoDiffieHellmanHello {
  1007. LoginCryptoDiffieHellmanHello::new()
  1008. }
  1009. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1010. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  1011. lock: ::protobuf::lazy::ONCE_INIT,
  1012. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  1013. };
  1014. unsafe {
  1015. descriptor.get(|| {
  1016. let mut fields = ::std::vec::Vec::new();
  1017. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  1018. "gc",
  1019. |m: &LoginCryptoDiffieHellmanHello| { &m.gc },
  1020. |m: &mut LoginCryptoDiffieHellmanHello| { &mut m.gc },
  1021. ));
  1022. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
  1023. "server_keys_known",
  1024. |m: &LoginCryptoDiffieHellmanHello| { &m.server_keys_known },
  1025. |m: &mut LoginCryptoDiffieHellmanHello| { &mut m.server_keys_known },
  1026. ));
  1027. ::protobuf::reflect::MessageDescriptor::new::<LoginCryptoDiffieHellmanHello>(
  1028. "LoginCryptoDiffieHellmanHello",
  1029. fields,
  1030. file_descriptor_proto()
  1031. )
  1032. })
  1033. }
  1034. }
  1035. fn default_instance() -> &'static LoginCryptoDiffieHellmanHello {
  1036. static mut instance: ::protobuf::lazy::Lazy<LoginCryptoDiffieHellmanHello> = ::protobuf::lazy::Lazy {
  1037. lock: ::protobuf::lazy::ONCE_INIT,
  1038. ptr: 0 as *const LoginCryptoDiffieHellmanHello,
  1039. };
  1040. unsafe {
  1041. instance.get(LoginCryptoDiffieHellmanHello::new)
  1042. }
  1043. }
  1044. }
  1045. impl ::protobuf::Clear for LoginCryptoDiffieHellmanHello {
  1046. fn clear(&mut self) {
  1047. self.clear_gc();
  1048. self.clear_server_keys_known();
  1049. self.unknown_fields.clear();
  1050. }
  1051. }
  1052. impl ::std::fmt::Debug for LoginCryptoDiffieHellmanHello {
  1053. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  1054. ::protobuf::text_format::fmt(self, f)
  1055. }
  1056. }
  1057. impl ::protobuf::reflect::ProtobufValue for LoginCryptoDiffieHellmanHello {
  1058. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  1059. ::protobuf::reflect::ProtobufValueRef::Message(self)
  1060. }
  1061. }
  1062. #[derive(PartialEq,Clone,Default)]
  1063. pub struct FeatureSet {
  1064. // message fields
  1065. autoupdate2: ::std::option::Option<bool>,
  1066. current_location: ::std::option::Option<bool>,
  1067. // special fields
  1068. unknown_fields: ::protobuf::UnknownFields,
  1069. cached_size: ::protobuf::CachedSize,
  1070. }
  1071. impl FeatureSet {
  1072. pub fn new() -> FeatureSet {
  1073. ::std::default::Default::default()
  1074. }
  1075. // optional bool autoupdate2 = 1;
  1076. pub fn clear_autoupdate2(&mut self) {
  1077. self.autoupdate2 = ::std::option::Option::None;
  1078. }
  1079. pub fn has_autoupdate2(&self) -> bool {
  1080. self.autoupdate2.is_some()
  1081. }
  1082. // Param is passed by value, moved
  1083. pub fn set_autoupdate2(&mut self, v: bool) {
  1084. self.autoupdate2 = ::std::option::Option::Some(v);
  1085. }
  1086. pub fn get_autoupdate2(&self) -> bool {
  1087. self.autoupdate2.unwrap_or(false)
  1088. }
  1089. // optional bool current_location = 2;
  1090. pub fn clear_current_location(&mut self) {
  1091. self.current_location = ::std::option::Option::None;
  1092. }
  1093. pub fn has_current_location(&self) -> bool {
  1094. self.current_location.is_some()
  1095. }
  1096. // Param is passed by value, moved
  1097. pub fn set_current_location(&mut self, v: bool) {
  1098. self.current_location = ::std::option::Option::Some(v);
  1099. }
  1100. pub fn get_current_location(&self) -> bool {
  1101. self.current_location.unwrap_or(false)
  1102. }
  1103. }
  1104. impl ::protobuf::Message for FeatureSet {
  1105. fn is_initialized(&self) -> bool {
  1106. true
  1107. }
  1108. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  1109. while !is.eof()? {
  1110. let (field_number, wire_type) = is.read_tag_unpack()?;
  1111. match field_number {
  1112. 1 => {
  1113. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1114. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1115. }
  1116. let tmp = is.read_bool()?;
  1117. self.autoupdate2 = ::std::option::Option::Some(tmp);
  1118. },
  1119. 2 => {
  1120. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1121. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1122. }
  1123. let tmp = is.read_bool()?;
  1124. self.current_location = ::std::option::Option::Some(tmp);
  1125. },
  1126. _ => {
  1127. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1128. },
  1129. };
  1130. }
  1131. ::std::result::Result::Ok(())
  1132. }
  1133. // Compute sizes of nested messages
  1134. #[allow(unused_variables)]
  1135. fn compute_size(&self) -> u32 {
  1136. let mut my_size = 0;
  1137. if let Some(v) = self.autoupdate2 {
  1138. my_size += 2;
  1139. }
  1140. if let Some(v) = self.current_location {
  1141. my_size += 2;
  1142. }
  1143. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1144. self.cached_size.set(my_size);
  1145. my_size
  1146. }
  1147. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  1148. if let Some(v) = self.autoupdate2 {
  1149. os.write_bool(1, v)?;
  1150. }
  1151. if let Some(v) = self.current_location {
  1152. os.write_bool(2, v)?;
  1153. }
  1154. os.write_unknown_fields(self.get_unknown_fields())?;
  1155. ::std::result::Result::Ok(())
  1156. }
  1157. fn get_cached_size(&self) -> u32 {
  1158. self.cached_size.get()
  1159. }
  1160. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1161. &self.unknown_fields
  1162. }
  1163. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1164. &mut self.unknown_fields
  1165. }
  1166. fn as_any(&self) -> &::std::any::Any {
  1167. self as &::std::any::Any
  1168. }
  1169. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  1170. self as &mut ::std::any::Any
  1171. }
  1172. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  1173. self
  1174. }
  1175. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1176. Self::descriptor_static()
  1177. }
  1178. fn new() -> FeatureSet {
  1179. FeatureSet::new()
  1180. }
  1181. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1182. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  1183. lock: ::protobuf::lazy::ONCE_INIT,
  1184. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  1185. };
  1186. unsafe {
  1187. descriptor.get(|| {
  1188. let mut fields = ::std::vec::Vec::new();
  1189. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
  1190. "autoupdate2",
  1191. |m: &FeatureSet| { &m.autoupdate2 },
  1192. |m: &mut FeatureSet| { &mut m.autoupdate2 },
  1193. ));
  1194. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
  1195. "current_location",
  1196. |m: &FeatureSet| { &m.current_location },
  1197. |m: &mut FeatureSet| { &mut m.current_location },
  1198. ));
  1199. ::protobuf::reflect::MessageDescriptor::new::<FeatureSet>(
  1200. "FeatureSet",
  1201. fields,
  1202. file_descriptor_proto()
  1203. )
  1204. })
  1205. }
  1206. }
  1207. fn default_instance() -> &'static FeatureSet {
  1208. static mut instance: ::protobuf::lazy::Lazy<FeatureSet> = ::protobuf::lazy::Lazy {
  1209. lock: ::protobuf::lazy::ONCE_INIT,
  1210. ptr: 0 as *const FeatureSet,
  1211. };
  1212. unsafe {
  1213. instance.get(FeatureSet::new)
  1214. }
  1215. }
  1216. }
  1217. impl ::protobuf::Clear for FeatureSet {
  1218. fn clear(&mut self) {
  1219. self.clear_autoupdate2();
  1220. self.clear_current_location();
  1221. self.unknown_fields.clear();
  1222. }
  1223. }
  1224. impl ::std::fmt::Debug for FeatureSet {
  1225. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  1226. ::protobuf::text_format::fmt(self, f)
  1227. }
  1228. }
  1229. impl ::protobuf::reflect::ProtobufValue for FeatureSet {
  1230. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  1231. ::protobuf::reflect::ProtobufValueRef::Message(self)
  1232. }
  1233. }
  1234. #[derive(PartialEq,Clone,Default)]
  1235. pub struct APResponseMessage {
  1236. // message fields
  1237. challenge: ::protobuf::SingularPtrField<APChallenge>,
  1238. upgrade: ::protobuf::SingularPtrField<UpgradeRequiredMessage>,
  1239. login_failed: ::protobuf::SingularPtrField<APLoginFailed>,
  1240. // special fields
  1241. unknown_fields: ::protobuf::UnknownFields,
  1242. cached_size: ::protobuf::CachedSize,
  1243. }
  1244. impl APResponseMessage {
  1245. pub fn new() -> APResponseMessage {
  1246. ::std::default::Default::default()
  1247. }
  1248. // optional .APChallenge challenge = 10;
  1249. pub fn clear_challenge(&mut self) {
  1250. self.challenge.clear();
  1251. }
  1252. pub fn has_challenge(&self) -> bool {
  1253. self.challenge.is_some()
  1254. }
  1255. // Param is passed by value, moved
  1256. pub fn set_challenge(&mut self, v: APChallenge) {
  1257. self.challenge = ::protobuf::SingularPtrField::some(v);
  1258. }
  1259. // Mutable pointer to the field.
  1260. // If field is not initialized, it is initialized with default value first.
  1261. pub fn mut_challenge(&mut self) -> &mut APChallenge {
  1262. if self.challenge.is_none() {
  1263. self.challenge.set_default();
  1264. }
  1265. self.challenge.as_mut().unwrap()
  1266. }
  1267. // Take field
  1268. pub fn take_challenge(&mut self) -> APChallenge {
  1269. self.challenge.take().unwrap_or_else(|| APChallenge::new())
  1270. }
  1271. pub fn get_challenge(&self) -> &APChallenge {
  1272. self.challenge.as_ref().unwrap_or_else(|| APChallenge::default_instance())
  1273. }
  1274. // optional .UpgradeRequiredMessage upgrade = 20;
  1275. pub fn clear_upgrade(&mut self) {
  1276. self.upgrade.clear();
  1277. }
  1278. pub fn has_upgrade(&self) -> bool {
  1279. self.upgrade.is_some()
  1280. }
  1281. // Param is passed by value, moved
  1282. pub fn set_upgrade(&mut self, v: UpgradeRequiredMessage) {
  1283. self.upgrade = ::protobuf::SingularPtrField::some(v);
  1284. }
  1285. // Mutable pointer to the field.
  1286. // If field is not initialized, it is initialized with default value first.
  1287. pub fn mut_upgrade(&mut self) -> &mut UpgradeRequiredMessage {
  1288. if self.upgrade.is_none() {
  1289. self.upgrade.set_default();
  1290. }
  1291. self.upgrade.as_mut().unwrap()
  1292. }
  1293. // Take field
  1294. pub fn take_upgrade(&mut self) -> UpgradeRequiredMessage {
  1295. self.upgrade.take().unwrap_or_else(|| UpgradeRequiredMessage::new())
  1296. }
  1297. pub fn get_upgrade(&self) -> &UpgradeRequiredMessage {
  1298. self.upgrade.as_ref().unwrap_or_else(|| UpgradeRequiredMessage::default_instance())
  1299. }
  1300. // optional .APLoginFailed login_failed = 30;
  1301. pub fn clear_login_failed(&mut self) {
  1302. self.login_failed.clear();
  1303. }
  1304. pub fn has_login_failed(&self) -> bool {
  1305. self.login_failed.is_some()
  1306. }
  1307. // Param is passed by value, moved
  1308. pub fn set_login_failed(&mut self, v: APLoginFailed) {
  1309. self.login_failed = ::protobuf::SingularPtrField::some(v);
  1310. }
  1311. // Mutable pointer to the field.
  1312. // If field is not initialized, it is initialized with default value first.
  1313. pub fn mut_login_failed(&mut self) -> &mut APLoginFailed {
  1314. if self.login_failed.is_none() {
  1315. self.login_failed.set_default();
  1316. }
  1317. self.login_failed.as_mut().unwrap()
  1318. }
  1319. // Take field
  1320. pub fn take_login_failed(&mut self) -> APLoginFailed {
  1321. self.login_failed.take().unwrap_or_else(|| APLoginFailed::new())
  1322. }
  1323. pub fn get_login_failed(&self) -> &APLoginFailed {
  1324. self.login_failed.as_ref().unwrap_or_else(|| APLoginFailed::default_instance())
  1325. }
  1326. }
  1327. impl ::protobuf::Message for APResponseMessage {
  1328. fn is_initialized(&self) -> bool {
  1329. for v in &self.challenge {
  1330. if !v.is_initialized() {
  1331. return false;
  1332. }
  1333. };
  1334. for v in &self.upgrade {
  1335. if !v.is_initialized() {
  1336. return false;
  1337. }
  1338. };
  1339. for v in &self.login_failed {
  1340. if !v.is_initialized() {
  1341. return false;
  1342. }
  1343. };
  1344. true
  1345. }
  1346. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  1347. while !is.eof()? {
  1348. let (field_number, wire_type) = is.read_tag_unpack()?;
  1349. match field_number {
  1350. 10 => {
  1351. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.challenge)?;
  1352. },
  1353. 20 => {
  1354. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.upgrade)?;
  1355. },
  1356. 30 => {
  1357. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_failed)?;
  1358. },
  1359. _ => {
  1360. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1361. },
  1362. };
  1363. }
  1364. ::std::result::Result::Ok(())
  1365. }
  1366. // Compute sizes of nested messages
  1367. #[allow(unused_variables)]
  1368. fn compute_size(&self) -> u32 {
  1369. let mut my_size = 0;
  1370. if let Some(ref v) = self.challenge.as_ref() {
  1371. let len = v.compute_size();
  1372. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1373. }
  1374. if let Some(ref v) = self.upgrade.as_ref() {
  1375. let len = v.compute_size();
  1376. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1377. }
  1378. if let Some(ref v) = self.login_failed.as_ref() {
  1379. let len = v.compute_size();
  1380. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1381. }
  1382. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1383. self.cached_size.set(my_size);
  1384. my_size
  1385. }
  1386. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  1387. if let Some(ref v) = self.challenge.as_ref() {
  1388. os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1389. os.write_raw_varint32(v.get_cached_size())?;
  1390. v.write_to_with_cached_sizes(os)?;
  1391. }
  1392. if let Some(ref v) = self.upgrade.as_ref() {
  1393. os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1394. os.write_raw_varint32(v.get_cached_size())?;
  1395. v.write_to_with_cached_sizes(os)?;
  1396. }
  1397. if let Some(ref v) = self.login_failed.as_ref() {
  1398. os.write_tag(30, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1399. os.write_raw_varint32(v.get_cached_size())?;
  1400. v.write_to_with_cached_sizes(os)?;
  1401. }
  1402. os.write_unknown_fields(self.get_unknown_fields())?;
  1403. ::std::result::Result::Ok(())
  1404. }
  1405. fn get_cached_size(&self) -> u32 {
  1406. self.cached_size.get()
  1407. }
  1408. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1409. &self.unknown_fields
  1410. }
  1411. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1412. &mut self.unknown_fields
  1413. }
  1414. fn as_any(&self) -> &::std::any::Any {
  1415. self as &::std::any::Any
  1416. }
  1417. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  1418. self as &mut ::std::any::Any
  1419. }
  1420. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  1421. self
  1422. }
  1423. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1424. Self::descriptor_static()
  1425. }
  1426. fn new() -> APResponseMessage {
  1427. APResponseMessage::new()
  1428. }
  1429. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1430. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  1431. lock: ::protobuf::lazy::ONCE_INIT,
  1432. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  1433. };
  1434. unsafe {
  1435. descriptor.get(|| {
  1436. let mut fields = ::std::vec::Vec::new();
  1437. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<APChallenge>>(
  1438. "challenge",
  1439. |m: &APResponseMessage| { &m.challenge },
  1440. |m: &mut APResponseMessage| { &mut m.challenge },
  1441. ));
  1442. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<UpgradeRequiredMessage>>(
  1443. "upgrade",
  1444. |m: &APResponseMessage| { &m.upgrade },
  1445. |m: &mut APResponseMessage| { &mut m.upgrade },
  1446. ));
  1447. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<APLoginFailed>>(
  1448. "login_failed",
  1449. |m: &APResponseMessage| { &m.login_failed },
  1450. |m: &mut APResponseMessage| { &mut m.login_failed },
  1451. ));
  1452. ::protobuf::reflect::MessageDescriptor::new::<APResponseMessage>(
  1453. "APResponseMessage",
  1454. fields,
  1455. file_descriptor_proto()
  1456. )
  1457. })
  1458. }
  1459. }
  1460. fn default_instance() -> &'static APResponseMessage {
  1461. static mut instance: ::protobuf::lazy::Lazy<APResponseMessage> = ::protobuf::lazy::Lazy {
  1462. lock: ::protobuf::lazy::ONCE_INIT,
  1463. ptr: 0 as *const APResponseMessage,
  1464. };
  1465. unsafe {
  1466. instance.get(APResponseMessage::new)
  1467. }
  1468. }
  1469. }
  1470. impl ::protobuf::Clear for APResponseMessage {
  1471. fn clear(&mut self) {
  1472. self.clear_challenge();
  1473. self.clear_upgrade();
  1474. self.clear_login_failed();
  1475. self.unknown_fields.clear();
  1476. }
  1477. }
  1478. impl ::std::fmt::Debug for APResponseMessage {
  1479. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  1480. ::protobuf::text_format::fmt(self, f)
  1481. }
  1482. }
  1483. impl ::protobuf::reflect::ProtobufValue for APResponseMessage {
  1484. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  1485. ::protobuf::reflect::ProtobufValueRef::Message(self)
  1486. }
  1487. }
  1488. #[derive(PartialEq,Clone,Default)]
  1489. pub struct APChallenge {
  1490. // message fields
  1491. login_crypto_challenge: ::protobuf::SingularPtrField<LoginCryptoChallengeUnion>,
  1492. fingerprint_challenge: ::protobuf::SingularPtrField<FingerprintChallengeUnion>,
  1493. pow_challenge: ::protobuf::SingularPtrField<PoWChallengeUnion>,
  1494. crypto_challenge: ::protobuf::SingularPtrField<CryptoChallengeUnion>,
  1495. server_nonce: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  1496. padding: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  1497. // special fields
  1498. unknown_fields: ::protobuf::UnknownFields,
  1499. cached_size: ::protobuf::CachedSize,
  1500. }
  1501. impl APChallenge {
  1502. pub fn new() -> APChallenge {
  1503. ::std::default::Default::default()
  1504. }
  1505. // required .LoginCryptoChallengeUnion login_crypto_challenge = 10;
  1506. pub fn clear_login_crypto_challenge(&mut self) {
  1507. self.login_crypto_challenge.clear();
  1508. }
  1509. pub fn has_login_crypto_challenge(&self) -> bool {
  1510. self.login_crypto_challenge.is_some()
  1511. }
  1512. // Param is passed by value, moved
  1513. pub fn set_login_crypto_challenge(&mut self, v: LoginCryptoChallengeUnion) {
  1514. self.login_crypto_challenge = ::protobuf::SingularPtrField::some(v);
  1515. }
  1516. // Mutable pointer to the field.
  1517. // If field is not initialized, it is initialized with default value first.
  1518. pub fn mut_login_crypto_challenge(&mut self) -> &mut LoginCryptoChallengeUnion {
  1519. if self.login_crypto_challenge.is_none() {
  1520. self.login_crypto_challenge.set_default();
  1521. }
  1522. self.login_crypto_challenge.as_mut().unwrap()
  1523. }
  1524. // Take field
  1525. pub fn take_login_crypto_challenge(&mut self) -> LoginCryptoChallengeUnion {
  1526. self.login_crypto_challenge.take().unwrap_or_else(|| LoginCryptoChallengeUnion::new())
  1527. }
  1528. pub fn get_login_crypto_challenge(&self) -> &LoginCryptoChallengeUnion {
  1529. self.login_crypto_challenge.as_ref().unwrap_or_else(|| LoginCryptoChallengeUnion::default_instance())
  1530. }
  1531. // required .FingerprintChallengeUnion fingerprint_challenge = 20;
  1532. pub fn clear_fingerprint_challenge(&mut self) {
  1533. self.fingerprint_challenge.clear();
  1534. }
  1535. pub fn has_fingerprint_challenge(&self) -> bool {
  1536. self.fingerprint_challenge.is_some()
  1537. }
  1538. // Param is passed by value, moved
  1539. pub fn set_fingerprint_challenge(&mut self, v: FingerprintChallengeUnion) {
  1540. self.fingerprint_challenge = ::protobuf::SingularPtrField::some(v);
  1541. }
  1542. // Mutable pointer to the field.
  1543. // If field is not initialized, it is initialized with default value first.
  1544. pub fn mut_fingerprint_challenge(&mut self) -> &mut FingerprintChallengeUnion {
  1545. if self.fingerprint_challenge.is_none() {
  1546. self.fingerprint_challenge.set_default();
  1547. }
  1548. self.fingerprint_challenge.as_mut().unwrap()
  1549. }
  1550. // Take field
  1551. pub fn take_fingerprint_challenge(&mut self) -> FingerprintChallengeUnion {
  1552. self.fingerprint_challenge.take().unwrap_or_else(|| FingerprintChallengeUnion::new())
  1553. }
  1554. pub fn get_fingerprint_challenge(&self) -> &FingerprintChallengeUnion {
  1555. self.fingerprint_challenge.as_ref().unwrap_or_else(|| FingerprintChallengeUnion::default_instance())
  1556. }
  1557. // required .PoWChallengeUnion pow_challenge = 30;
  1558. pub fn clear_pow_challenge(&mut self) {
  1559. self.pow_challenge.clear();
  1560. }
  1561. pub fn has_pow_challenge(&self) -> bool {
  1562. self.pow_challenge.is_some()
  1563. }
  1564. // Param is passed by value, moved
  1565. pub fn set_pow_challenge(&mut self, v: PoWChallengeUnion) {
  1566. self.pow_challenge = ::protobuf::SingularPtrField::some(v);
  1567. }
  1568. // Mutable pointer to the field.
  1569. // If field is not initialized, it is initialized with default value first.
  1570. pub fn mut_pow_challenge(&mut self) -> &mut PoWChallengeUnion {
  1571. if self.pow_challenge.is_none() {
  1572. self.pow_challenge.set_default();
  1573. }
  1574. self.pow_challenge.as_mut().unwrap()
  1575. }
  1576. // Take field
  1577. pub fn take_pow_challenge(&mut self) -> PoWChallengeUnion {
  1578. self.pow_challenge.take().unwrap_or_else(|| PoWChallengeUnion::new())
  1579. }
  1580. pub fn get_pow_challenge(&self) -> &PoWChallengeUnion {
  1581. self.pow_challenge.as_ref().unwrap_or_else(|| PoWChallengeUnion::default_instance())
  1582. }
  1583. // required .CryptoChallengeUnion crypto_challenge = 40;
  1584. pub fn clear_crypto_challenge(&mut self) {
  1585. self.crypto_challenge.clear();
  1586. }
  1587. pub fn has_crypto_challenge(&self) -> bool {
  1588. self.crypto_challenge.is_some()
  1589. }
  1590. // Param is passed by value, moved
  1591. pub fn set_crypto_challenge(&mut self, v: CryptoChallengeUnion) {
  1592. self.crypto_challenge = ::protobuf::SingularPtrField::some(v);
  1593. }
  1594. // Mutable pointer to the field.
  1595. // If field is not initialized, it is initialized with default value first.
  1596. pub fn mut_crypto_challenge(&mut self) -> &mut CryptoChallengeUnion {
  1597. if self.crypto_challenge.is_none() {
  1598. self.crypto_challenge.set_default();
  1599. }
  1600. self.crypto_challenge.as_mut().unwrap()
  1601. }
  1602. // Take field
  1603. pub fn take_crypto_challenge(&mut self) -> CryptoChallengeUnion {
  1604. self.crypto_challenge.take().unwrap_or_else(|| CryptoChallengeUnion::new())
  1605. }
  1606. pub fn get_crypto_challenge(&self) -> &CryptoChallengeUnion {
  1607. self.crypto_challenge.as_ref().unwrap_or_else(|| CryptoChallengeUnion::default_instance())
  1608. }
  1609. // required bytes server_nonce = 50;
  1610. pub fn clear_server_nonce(&mut self) {
  1611. self.server_nonce.clear();
  1612. }
  1613. pub fn has_server_nonce(&self) -> bool {
  1614. self.server_nonce.is_some()
  1615. }
  1616. // Param is passed by value, moved
  1617. pub fn set_server_nonce(&mut self, v: ::std::vec::Vec<u8>) {
  1618. self.server_nonce = ::protobuf::SingularField::some(v);
  1619. }
  1620. // Mutable pointer to the field.
  1621. // If field is not initialized, it is initialized with default value first.
  1622. pub fn mut_server_nonce(&mut self) -> &mut ::std::vec::Vec<u8> {
  1623. if self.server_nonce.is_none() {
  1624. self.server_nonce.set_default();
  1625. }
  1626. self.server_nonce.as_mut().unwrap()
  1627. }
  1628. // Take field
  1629. pub fn take_server_nonce(&mut self) -> ::std::vec::Vec<u8> {
  1630. self.server_nonce.take().unwrap_or_else(|| ::std::vec::Vec::new())
  1631. }
  1632. pub fn get_server_nonce(&self) -> &[u8] {
  1633. match self.server_nonce.as_ref() {
  1634. Some(v) => &v,
  1635. None => &[],
  1636. }
  1637. }
  1638. // optional bytes padding = 60;
  1639. pub fn clear_padding(&mut self) {
  1640. self.padding.clear();
  1641. }
  1642. pub fn has_padding(&self) -> bool {
  1643. self.padding.is_some()
  1644. }
  1645. // Param is passed by value, moved
  1646. pub fn set_padding(&mut self, v: ::std::vec::Vec<u8>) {
  1647. self.padding = ::protobuf::SingularField::some(v);
  1648. }
  1649. // Mutable pointer to the field.
  1650. // If field is not initialized, it is initialized with default value first.
  1651. pub fn mut_padding(&mut self) -> &mut ::std::vec::Vec<u8> {
  1652. if self.padding.is_none() {
  1653. self.padding.set_default();
  1654. }
  1655. self.padding.as_mut().unwrap()
  1656. }
  1657. // Take field
  1658. pub fn take_padding(&mut self) -> ::std::vec::Vec<u8> {
  1659. self.padding.take().unwrap_or_else(|| ::std::vec::Vec::new())
  1660. }
  1661. pub fn get_padding(&self) -> &[u8] {
  1662. match self.padding.as_ref() {
  1663. Some(v) => &v,
  1664. None => &[],
  1665. }
  1666. }
  1667. }
  1668. impl ::protobuf::Message for APChallenge {
  1669. fn is_initialized(&self) -> bool {
  1670. if self.login_crypto_challenge.is_none() {
  1671. return false;
  1672. }
  1673. if self.fingerprint_challenge.is_none() {
  1674. return false;
  1675. }
  1676. if self.pow_challenge.is_none() {
  1677. return false;
  1678. }
  1679. if self.crypto_challenge.is_none() {
  1680. return false;
  1681. }
  1682. if self.server_nonce.is_none() {
  1683. return false;
  1684. }
  1685. for v in &self.login_crypto_challenge {
  1686. if !v.is_initialized() {
  1687. return false;
  1688. }
  1689. };
  1690. for v in &self.fingerprint_challenge {
  1691. if !v.is_initialized() {
  1692. return false;
  1693. }
  1694. };
  1695. for v in &self.pow_challenge {
  1696. if !v.is_initialized() {
  1697. return false;
  1698. }
  1699. };
  1700. for v in &self.crypto_challenge {
  1701. if !v.is_initialized() {
  1702. return false;
  1703. }
  1704. };
  1705. true
  1706. }
  1707. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  1708. while !is.eof()? {
  1709. let (field_number, wire_type) = is.read_tag_unpack()?;
  1710. match field_number {
  1711. 10 => {
  1712. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_crypto_challenge)?;
  1713. },
  1714. 20 => {
  1715. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.fingerprint_challenge)?;
  1716. },
  1717. 30 => {
  1718. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.pow_challenge)?;
  1719. },
  1720. 40 => {
  1721. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.crypto_challenge)?;
  1722. },
  1723. 50 => {
  1724. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.server_nonce)?;
  1725. },
  1726. 60 => {
  1727. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.padding)?;
  1728. },
  1729. _ => {
  1730. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1731. },
  1732. };
  1733. }
  1734. ::std::result::Result::Ok(())
  1735. }
  1736. // Compute sizes of nested messages
  1737. #[allow(unused_variables)]
  1738. fn compute_size(&self) -> u32 {
  1739. let mut my_size = 0;
  1740. if let Some(ref v) = self.login_crypto_challenge.as_ref() {
  1741. let len = v.compute_size();
  1742. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1743. }
  1744. if let Some(ref v) = self.fingerprint_challenge.as_ref() {
  1745. let len = v.compute_size();
  1746. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1747. }
  1748. if let Some(ref v) = self.pow_challenge.as_ref() {
  1749. let len = v.compute_size();
  1750. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1751. }
  1752. if let Some(ref v) = self.crypto_challenge.as_ref() {
  1753. let len = v.compute_size();
  1754. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1755. }
  1756. if let Some(ref v) = self.server_nonce.as_ref() {
  1757. my_size += ::protobuf::rt::bytes_size(50, &v);
  1758. }
  1759. if let Some(ref v) = self.padding.as_ref() {
  1760. my_size += ::protobuf::rt::bytes_size(60, &v);
  1761. }
  1762. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1763. self.cached_size.set(my_size);
  1764. my_size
  1765. }
  1766. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  1767. if let Some(ref v) = self.login_crypto_challenge.as_ref() {
  1768. os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1769. os.write_raw_varint32(v.get_cached_size())?;
  1770. v.write_to_with_cached_sizes(os)?;
  1771. }
  1772. if let Some(ref v) = self.fingerprint_challenge.as_ref() {
  1773. os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1774. os.write_raw_varint32(v.get_cached_size())?;
  1775. v.write_to_with_cached_sizes(os)?;
  1776. }
  1777. if let Some(ref v) = self.pow_challenge.as_ref() {
  1778. os.write_tag(30, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1779. os.write_raw_varint32(v.get_cached_size())?;
  1780. v.write_to_with_cached_sizes(os)?;
  1781. }
  1782. if let Some(ref v) = self.crypto_challenge.as_ref() {
  1783. os.write_tag(40, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1784. os.write_raw_varint32(v.get_cached_size())?;
  1785. v.write_to_with_cached_sizes(os)?;
  1786. }
  1787. if let Some(ref v) = self.server_nonce.as_ref() {
  1788. os.write_bytes(50, &v)?;
  1789. }
  1790. if let Some(ref v) = self.padding.as_ref() {
  1791. os.write_bytes(60, &v)?;
  1792. }
  1793. os.write_unknown_fields(self.get_unknown_fields())?;
  1794. ::std::result::Result::Ok(())
  1795. }
  1796. fn get_cached_size(&self) -> u32 {
  1797. self.cached_size.get()
  1798. }
  1799. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1800. &self.unknown_fields
  1801. }
  1802. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1803. &mut self.unknown_fields
  1804. }
  1805. fn as_any(&self) -> &::std::any::Any {
  1806. self as &::std::any::Any
  1807. }
  1808. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  1809. self as &mut ::std::any::Any
  1810. }
  1811. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  1812. self
  1813. }
  1814. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1815. Self::descriptor_static()
  1816. }
  1817. fn new() -> APChallenge {
  1818. APChallenge::new()
  1819. }
  1820. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  1821. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  1822. lock: ::protobuf::lazy::ONCE_INIT,
  1823. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  1824. };
  1825. unsafe {
  1826. descriptor.get(|| {
  1827. let mut fields = ::std::vec::Vec::new();
  1828. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<LoginCryptoChallengeUnion>>(
  1829. "login_crypto_challenge",
  1830. |m: &APChallenge| { &m.login_crypto_challenge },
  1831. |m: &mut APChallenge| { &mut m.login_crypto_challenge },
  1832. ));
  1833. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<FingerprintChallengeUnion>>(
  1834. "fingerprint_challenge",
  1835. |m: &APChallenge| { &m.fingerprint_challenge },
  1836. |m: &mut APChallenge| { &mut m.fingerprint_challenge },
  1837. ));
  1838. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<PoWChallengeUnion>>(
  1839. "pow_challenge",
  1840. |m: &APChallenge| { &m.pow_challenge },
  1841. |m: &mut APChallenge| { &mut m.pow_challenge },
  1842. ));
  1843. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<CryptoChallengeUnion>>(
  1844. "crypto_challenge",
  1845. |m: &APChallenge| { &m.crypto_challenge },
  1846. |m: &mut APChallenge| { &mut m.crypto_challenge },
  1847. ));
  1848. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  1849. "server_nonce",
  1850. |m: &APChallenge| { &m.server_nonce },
  1851. |m: &mut APChallenge| { &mut m.server_nonce },
  1852. ));
  1853. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  1854. "padding",
  1855. |m: &APChallenge| { &m.padding },
  1856. |m: &mut APChallenge| { &mut m.padding },
  1857. ));
  1858. ::protobuf::reflect::MessageDescriptor::new::<APChallenge>(
  1859. "APChallenge",
  1860. fields,
  1861. file_descriptor_proto()
  1862. )
  1863. })
  1864. }
  1865. }
  1866. fn default_instance() -> &'static APChallenge {
  1867. static mut instance: ::protobuf::lazy::Lazy<APChallenge> = ::protobuf::lazy::Lazy {
  1868. lock: ::protobuf::lazy::ONCE_INIT,
  1869. ptr: 0 as *const APChallenge,
  1870. };
  1871. unsafe {
  1872. instance.get(APChallenge::new)
  1873. }
  1874. }
  1875. }
  1876. impl ::protobuf::Clear for APChallenge {
  1877. fn clear(&mut self) {
  1878. self.clear_login_crypto_challenge();
  1879. self.clear_fingerprint_challenge();
  1880. self.clear_pow_challenge();
  1881. self.clear_crypto_challenge();
  1882. self.clear_server_nonce();
  1883. self.clear_padding();
  1884. self.unknown_fields.clear();
  1885. }
  1886. }
  1887. impl ::std::fmt::Debug for APChallenge {
  1888. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  1889. ::protobuf::text_format::fmt(self, f)
  1890. }
  1891. }
  1892. impl ::protobuf::reflect::ProtobufValue for APChallenge {
  1893. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  1894. ::protobuf::reflect::ProtobufValueRef::Message(self)
  1895. }
  1896. }
  1897. #[derive(PartialEq,Clone,Default)]
  1898. pub struct LoginCryptoChallengeUnion {
  1899. // message fields
  1900. diffie_hellman: ::protobuf::SingularPtrField<LoginCryptoDiffieHellmanChallenge>,
  1901. // special fields
  1902. unknown_fields: ::protobuf::UnknownFields,
  1903. cached_size: ::protobuf::CachedSize,
  1904. }
  1905. impl LoginCryptoChallengeUnion {
  1906. pub fn new() -> LoginCryptoChallengeUnion {
  1907. ::std::default::Default::default()
  1908. }
  1909. // optional .LoginCryptoDiffieHellmanChallenge diffie_hellman = 10;
  1910. pub fn clear_diffie_hellman(&mut self) {
  1911. self.diffie_hellman.clear();
  1912. }
  1913. pub fn has_diffie_hellman(&self) -> bool {
  1914. self.diffie_hellman.is_some()
  1915. }
  1916. // Param is passed by value, moved
  1917. pub fn set_diffie_hellman(&mut self, v: LoginCryptoDiffieHellmanChallenge) {
  1918. self.diffie_hellman = ::protobuf::SingularPtrField::some(v);
  1919. }
  1920. // Mutable pointer to the field.
  1921. // If field is not initialized, it is initialized with default value first.
  1922. pub fn mut_diffie_hellman(&mut self) -> &mut LoginCryptoDiffieHellmanChallenge {
  1923. if self.diffie_hellman.is_none() {
  1924. self.diffie_hellman.set_default();
  1925. }
  1926. self.diffie_hellman.as_mut().unwrap()
  1927. }
  1928. // Take field
  1929. pub fn take_diffie_hellman(&mut self) -> LoginCryptoDiffieHellmanChallenge {
  1930. self.diffie_hellman.take().unwrap_or_else(|| LoginCryptoDiffieHellmanChallenge::new())
  1931. }
  1932. pub fn get_diffie_hellman(&self) -> &LoginCryptoDiffieHellmanChallenge {
  1933. self.diffie_hellman.as_ref().unwrap_or_else(|| LoginCryptoDiffieHellmanChallenge::default_instance())
  1934. }
  1935. }
  1936. impl ::protobuf::Message for LoginCryptoChallengeUnion {
  1937. fn is_initialized(&self) -> bool {
  1938. for v in &self.diffie_hellman {
  1939. if !v.is_initialized() {
  1940. return false;
  1941. }
  1942. };
  1943. true
  1944. }
  1945. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  1946. while !is.eof()? {
  1947. let (field_number, wire_type) = is.read_tag_unpack()?;
  1948. match field_number {
  1949. 10 => {
  1950. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.diffie_hellman)?;
  1951. },
  1952. _ => {
  1953. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1954. },
  1955. };
  1956. }
  1957. ::std::result::Result::Ok(())
  1958. }
  1959. // Compute sizes of nested messages
  1960. #[allow(unused_variables)]
  1961. fn compute_size(&self) -> u32 {
  1962. let mut my_size = 0;
  1963. if let Some(ref v) = self.diffie_hellman.as_ref() {
  1964. let len = v.compute_size();
  1965. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1966. }
  1967. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1968. self.cached_size.set(my_size);
  1969. my_size
  1970. }
  1971. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  1972. if let Some(ref v) = self.diffie_hellman.as_ref() {
  1973. os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1974. os.write_raw_varint32(v.get_cached_size())?;
  1975. v.write_to_with_cached_sizes(os)?;
  1976. }
  1977. os.write_unknown_fields(self.get_unknown_fields())?;
  1978. ::std::result::Result::Ok(())
  1979. }
  1980. fn get_cached_size(&self) -> u32 {
  1981. self.cached_size.get()
  1982. }
  1983. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1984. &self.unknown_fields
  1985. }
  1986. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1987. &mut self.unknown_fields
  1988. }
  1989. fn as_any(&self) -> &::std::any::Any {
  1990. self as &::std::any::Any
  1991. }
  1992. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  1993. self as &mut ::std::any::Any
  1994. }
  1995. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  1996. self
  1997. }
  1998. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1999. Self::descriptor_static()
  2000. }
  2001. fn new() -> LoginCryptoChallengeUnion {
  2002. LoginCryptoChallengeUnion::new()
  2003. }
  2004. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2005. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  2006. lock: ::protobuf::lazy::ONCE_INIT,
  2007. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  2008. };
  2009. unsafe {
  2010. descriptor.get(|| {
  2011. let mut fields = ::std::vec::Vec::new();
  2012. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<LoginCryptoDiffieHellmanChallenge>>(
  2013. "diffie_hellman",
  2014. |m: &LoginCryptoChallengeUnion| { &m.diffie_hellman },
  2015. |m: &mut LoginCryptoChallengeUnion| { &mut m.diffie_hellman },
  2016. ));
  2017. ::protobuf::reflect::MessageDescriptor::new::<LoginCryptoChallengeUnion>(
  2018. "LoginCryptoChallengeUnion",
  2019. fields,
  2020. file_descriptor_proto()
  2021. )
  2022. })
  2023. }
  2024. }
  2025. fn default_instance() -> &'static LoginCryptoChallengeUnion {
  2026. static mut instance: ::protobuf::lazy::Lazy<LoginCryptoChallengeUnion> = ::protobuf::lazy::Lazy {
  2027. lock: ::protobuf::lazy::ONCE_INIT,
  2028. ptr: 0 as *const LoginCryptoChallengeUnion,
  2029. };
  2030. unsafe {
  2031. instance.get(LoginCryptoChallengeUnion::new)
  2032. }
  2033. }
  2034. }
  2035. impl ::protobuf::Clear for LoginCryptoChallengeUnion {
  2036. fn clear(&mut self) {
  2037. self.clear_diffie_hellman();
  2038. self.unknown_fields.clear();
  2039. }
  2040. }
  2041. impl ::std::fmt::Debug for LoginCryptoChallengeUnion {
  2042. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  2043. ::protobuf::text_format::fmt(self, f)
  2044. }
  2045. }
  2046. impl ::protobuf::reflect::ProtobufValue for LoginCryptoChallengeUnion {
  2047. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  2048. ::protobuf::reflect::ProtobufValueRef::Message(self)
  2049. }
  2050. }
  2051. #[derive(PartialEq,Clone,Default)]
  2052. pub struct LoginCryptoDiffieHellmanChallenge {
  2053. // message fields
  2054. gs: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2055. server_signature_key: ::std::option::Option<i32>,
  2056. gs_signature: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2057. // special fields
  2058. unknown_fields: ::protobuf::UnknownFields,
  2059. cached_size: ::protobuf::CachedSize,
  2060. }
  2061. impl LoginCryptoDiffieHellmanChallenge {
  2062. pub fn new() -> LoginCryptoDiffieHellmanChallenge {
  2063. ::std::default::Default::default()
  2064. }
  2065. // required bytes gs = 10;
  2066. pub fn clear_gs(&mut self) {
  2067. self.gs.clear();
  2068. }
  2069. pub fn has_gs(&self) -> bool {
  2070. self.gs.is_some()
  2071. }
  2072. // Param is passed by value, moved
  2073. pub fn set_gs(&mut self, v: ::std::vec::Vec<u8>) {
  2074. self.gs = ::protobuf::SingularField::some(v);
  2075. }
  2076. // Mutable pointer to the field.
  2077. // If field is not initialized, it is initialized with default value first.
  2078. pub fn mut_gs(&mut self) -> &mut ::std::vec::Vec<u8> {
  2079. if self.gs.is_none() {
  2080. self.gs.set_default();
  2081. }
  2082. self.gs.as_mut().unwrap()
  2083. }
  2084. // Take field
  2085. pub fn take_gs(&mut self) -> ::std::vec::Vec<u8> {
  2086. self.gs.take().unwrap_or_else(|| ::std::vec::Vec::new())
  2087. }
  2088. pub fn get_gs(&self) -> &[u8] {
  2089. match self.gs.as_ref() {
  2090. Some(v) => &v,
  2091. None => &[],
  2092. }
  2093. }
  2094. // required int32 server_signature_key = 20;
  2095. pub fn clear_server_signature_key(&mut self) {
  2096. self.server_signature_key = ::std::option::Option::None;
  2097. }
  2098. pub fn has_server_signature_key(&self) -> bool {
  2099. self.server_signature_key.is_some()
  2100. }
  2101. // Param is passed by value, moved
  2102. pub fn set_server_signature_key(&mut self, v: i32) {
  2103. self.server_signature_key = ::std::option::Option::Some(v);
  2104. }
  2105. pub fn get_server_signature_key(&self) -> i32 {
  2106. self.server_signature_key.unwrap_or(0)
  2107. }
  2108. // required bytes gs_signature = 30;
  2109. pub fn clear_gs_signature(&mut self) {
  2110. self.gs_signature.clear();
  2111. }
  2112. pub fn has_gs_signature(&self) -> bool {
  2113. self.gs_signature.is_some()
  2114. }
  2115. // Param is passed by value, moved
  2116. pub fn set_gs_signature(&mut self, v: ::std::vec::Vec<u8>) {
  2117. self.gs_signature = ::protobuf::SingularField::some(v);
  2118. }
  2119. // Mutable pointer to the field.
  2120. // If field is not initialized, it is initialized with default value first.
  2121. pub fn mut_gs_signature(&mut self) -> &mut ::std::vec::Vec<u8> {
  2122. if self.gs_signature.is_none() {
  2123. self.gs_signature.set_default();
  2124. }
  2125. self.gs_signature.as_mut().unwrap()
  2126. }
  2127. // Take field
  2128. pub fn take_gs_signature(&mut self) -> ::std::vec::Vec<u8> {
  2129. self.gs_signature.take().unwrap_or_else(|| ::std::vec::Vec::new())
  2130. }
  2131. pub fn get_gs_signature(&self) -> &[u8] {
  2132. match self.gs_signature.as_ref() {
  2133. Some(v) => &v,
  2134. None => &[],
  2135. }
  2136. }
  2137. }
  2138. impl ::protobuf::Message for LoginCryptoDiffieHellmanChallenge {
  2139. fn is_initialized(&self) -> bool {
  2140. if self.gs.is_none() {
  2141. return false;
  2142. }
  2143. if self.server_signature_key.is_none() {
  2144. return false;
  2145. }
  2146. if self.gs_signature.is_none() {
  2147. return false;
  2148. }
  2149. true
  2150. }
  2151. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  2152. while !is.eof()? {
  2153. let (field_number, wire_type) = is.read_tag_unpack()?;
  2154. match field_number {
  2155. 10 => {
  2156. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gs)?;
  2157. },
  2158. 20 => {
  2159. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  2160. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  2161. }
  2162. let tmp = is.read_int32()?;
  2163. self.server_signature_key = ::std::option::Option::Some(tmp);
  2164. },
  2165. 30 => {
  2166. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gs_signature)?;
  2167. },
  2168. _ => {
  2169. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  2170. },
  2171. };
  2172. }
  2173. ::std::result::Result::Ok(())
  2174. }
  2175. // Compute sizes of nested messages
  2176. #[allow(unused_variables)]
  2177. fn compute_size(&self) -> u32 {
  2178. let mut my_size = 0;
  2179. if let Some(ref v) = self.gs.as_ref() {
  2180. my_size += ::protobuf::rt::bytes_size(10, &v);
  2181. }
  2182. if let Some(v) = self.server_signature_key {
  2183. my_size += ::protobuf::rt::value_size(20, v, ::protobuf::wire_format::WireTypeVarint);
  2184. }
  2185. if let Some(ref v) = self.gs_signature.as_ref() {
  2186. my_size += ::protobuf::rt::bytes_size(30, &v);
  2187. }
  2188. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2189. self.cached_size.set(my_size);
  2190. my_size
  2191. }
  2192. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  2193. if let Some(ref v) = self.gs.as_ref() {
  2194. os.write_bytes(10, &v)?;
  2195. }
  2196. if let Some(v) = self.server_signature_key {
  2197. os.write_int32(20, v)?;
  2198. }
  2199. if let Some(ref v) = self.gs_signature.as_ref() {
  2200. os.write_bytes(30, &v)?;
  2201. }
  2202. os.write_unknown_fields(self.get_unknown_fields())?;
  2203. ::std::result::Result::Ok(())
  2204. }
  2205. fn get_cached_size(&self) -> u32 {
  2206. self.cached_size.get()
  2207. }
  2208. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2209. &self.unknown_fields
  2210. }
  2211. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2212. &mut self.unknown_fields
  2213. }
  2214. fn as_any(&self) -> &::std::any::Any {
  2215. self as &::std::any::Any
  2216. }
  2217. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  2218. self as &mut ::std::any::Any
  2219. }
  2220. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  2221. self
  2222. }
  2223. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2224. Self::descriptor_static()
  2225. }
  2226. fn new() -> LoginCryptoDiffieHellmanChallenge {
  2227. LoginCryptoDiffieHellmanChallenge::new()
  2228. }
  2229. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2230. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  2231. lock: ::protobuf::lazy::ONCE_INIT,
  2232. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  2233. };
  2234. unsafe {
  2235. descriptor.get(|| {
  2236. let mut fields = ::std::vec::Vec::new();
  2237. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  2238. "gs",
  2239. |m: &LoginCryptoDiffieHellmanChallenge| { &m.gs },
  2240. |m: &mut LoginCryptoDiffieHellmanChallenge| { &mut m.gs },
  2241. ));
  2242. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  2243. "server_signature_key",
  2244. |m: &LoginCryptoDiffieHellmanChallenge| { &m.server_signature_key },
  2245. |m: &mut LoginCryptoDiffieHellmanChallenge| { &mut m.server_signature_key },
  2246. ));
  2247. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  2248. "gs_signature",
  2249. |m: &LoginCryptoDiffieHellmanChallenge| { &m.gs_signature },
  2250. |m: &mut LoginCryptoDiffieHellmanChallenge| { &mut m.gs_signature },
  2251. ));
  2252. ::protobuf::reflect::MessageDescriptor::new::<LoginCryptoDiffieHellmanChallenge>(
  2253. "LoginCryptoDiffieHellmanChallenge",
  2254. fields,
  2255. file_descriptor_proto()
  2256. )
  2257. })
  2258. }
  2259. }
  2260. fn default_instance() -> &'static LoginCryptoDiffieHellmanChallenge {
  2261. static mut instance: ::protobuf::lazy::Lazy<LoginCryptoDiffieHellmanChallenge> = ::protobuf::lazy::Lazy {
  2262. lock: ::protobuf::lazy::ONCE_INIT,
  2263. ptr: 0 as *const LoginCryptoDiffieHellmanChallenge,
  2264. };
  2265. unsafe {
  2266. instance.get(LoginCryptoDiffieHellmanChallenge::new)
  2267. }
  2268. }
  2269. }
  2270. impl ::protobuf::Clear for LoginCryptoDiffieHellmanChallenge {
  2271. fn clear(&mut self) {
  2272. self.clear_gs();
  2273. self.clear_server_signature_key();
  2274. self.clear_gs_signature();
  2275. self.unknown_fields.clear();
  2276. }
  2277. }
  2278. impl ::std::fmt::Debug for LoginCryptoDiffieHellmanChallenge {
  2279. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  2280. ::protobuf::text_format::fmt(self, f)
  2281. }
  2282. }
  2283. impl ::protobuf::reflect::ProtobufValue for LoginCryptoDiffieHellmanChallenge {
  2284. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  2285. ::protobuf::reflect::ProtobufValueRef::Message(self)
  2286. }
  2287. }
  2288. #[derive(PartialEq,Clone,Default)]
  2289. pub struct FingerprintChallengeUnion {
  2290. // message fields
  2291. grain: ::protobuf::SingularPtrField<FingerprintGrainChallenge>,
  2292. hmac_ripemd: ::protobuf::SingularPtrField<FingerprintHmacRipemdChallenge>,
  2293. // special fields
  2294. unknown_fields: ::protobuf::UnknownFields,
  2295. cached_size: ::protobuf::CachedSize,
  2296. }
  2297. impl FingerprintChallengeUnion {
  2298. pub fn new() -> FingerprintChallengeUnion {
  2299. ::std::default::Default::default()
  2300. }
  2301. // optional .FingerprintGrainChallenge grain = 10;
  2302. pub fn clear_grain(&mut self) {
  2303. self.grain.clear();
  2304. }
  2305. pub fn has_grain(&self) -> bool {
  2306. self.grain.is_some()
  2307. }
  2308. // Param is passed by value, moved
  2309. pub fn set_grain(&mut self, v: FingerprintGrainChallenge) {
  2310. self.grain = ::protobuf::SingularPtrField::some(v);
  2311. }
  2312. // Mutable pointer to the field.
  2313. // If field is not initialized, it is initialized with default value first.
  2314. pub fn mut_grain(&mut self) -> &mut FingerprintGrainChallenge {
  2315. if self.grain.is_none() {
  2316. self.grain.set_default();
  2317. }
  2318. self.grain.as_mut().unwrap()
  2319. }
  2320. // Take field
  2321. pub fn take_grain(&mut self) -> FingerprintGrainChallenge {
  2322. self.grain.take().unwrap_or_else(|| FingerprintGrainChallenge::new())
  2323. }
  2324. pub fn get_grain(&self) -> &FingerprintGrainChallenge {
  2325. self.grain.as_ref().unwrap_or_else(|| FingerprintGrainChallenge::default_instance())
  2326. }
  2327. // optional .FingerprintHmacRipemdChallenge hmac_ripemd = 20;
  2328. pub fn clear_hmac_ripemd(&mut self) {
  2329. self.hmac_ripemd.clear();
  2330. }
  2331. pub fn has_hmac_ripemd(&self) -> bool {
  2332. self.hmac_ripemd.is_some()
  2333. }
  2334. // Param is passed by value, moved
  2335. pub fn set_hmac_ripemd(&mut self, v: FingerprintHmacRipemdChallenge) {
  2336. self.hmac_ripemd = ::protobuf::SingularPtrField::some(v);
  2337. }
  2338. // Mutable pointer to the field.
  2339. // If field is not initialized, it is initialized with default value first.
  2340. pub fn mut_hmac_ripemd(&mut self) -> &mut FingerprintHmacRipemdChallenge {
  2341. if self.hmac_ripemd.is_none() {
  2342. self.hmac_ripemd.set_default();
  2343. }
  2344. self.hmac_ripemd.as_mut().unwrap()
  2345. }
  2346. // Take field
  2347. pub fn take_hmac_ripemd(&mut self) -> FingerprintHmacRipemdChallenge {
  2348. self.hmac_ripemd.take().unwrap_or_else(|| FingerprintHmacRipemdChallenge::new())
  2349. }
  2350. pub fn get_hmac_ripemd(&self) -> &FingerprintHmacRipemdChallenge {
  2351. self.hmac_ripemd.as_ref().unwrap_or_else(|| FingerprintHmacRipemdChallenge::default_instance())
  2352. }
  2353. }
  2354. impl ::protobuf::Message for FingerprintChallengeUnion {
  2355. fn is_initialized(&self) -> bool {
  2356. for v in &self.grain {
  2357. if !v.is_initialized() {
  2358. return false;
  2359. }
  2360. };
  2361. for v in &self.hmac_ripemd {
  2362. if !v.is_initialized() {
  2363. return false;
  2364. }
  2365. };
  2366. true
  2367. }
  2368. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  2369. while !is.eof()? {
  2370. let (field_number, wire_type) = is.read_tag_unpack()?;
  2371. match field_number {
  2372. 10 => {
  2373. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.grain)?;
  2374. },
  2375. 20 => {
  2376. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.hmac_ripemd)?;
  2377. },
  2378. _ => {
  2379. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  2380. },
  2381. };
  2382. }
  2383. ::std::result::Result::Ok(())
  2384. }
  2385. // Compute sizes of nested messages
  2386. #[allow(unused_variables)]
  2387. fn compute_size(&self) -> u32 {
  2388. let mut my_size = 0;
  2389. if let Some(ref v) = self.grain.as_ref() {
  2390. let len = v.compute_size();
  2391. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  2392. }
  2393. if let Some(ref v) = self.hmac_ripemd.as_ref() {
  2394. let len = v.compute_size();
  2395. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  2396. }
  2397. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2398. self.cached_size.set(my_size);
  2399. my_size
  2400. }
  2401. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  2402. if let Some(ref v) = self.grain.as_ref() {
  2403. os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  2404. os.write_raw_varint32(v.get_cached_size())?;
  2405. v.write_to_with_cached_sizes(os)?;
  2406. }
  2407. if let Some(ref v) = self.hmac_ripemd.as_ref() {
  2408. os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  2409. os.write_raw_varint32(v.get_cached_size())?;
  2410. v.write_to_with_cached_sizes(os)?;
  2411. }
  2412. os.write_unknown_fields(self.get_unknown_fields())?;
  2413. ::std::result::Result::Ok(())
  2414. }
  2415. fn get_cached_size(&self) -> u32 {
  2416. self.cached_size.get()
  2417. }
  2418. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2419. &self.unknown_fields
  2420. }
  2421. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2422. &mut self.unknown_fields
  2423. }
  2424. fn as_any(&self) -> &::std::any::Any {
  2425. self as &::std::any::Any
  2426. }
  2427. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  2428. self as &mut ::std::any::Any
  2429. }
  2430. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  2431. self
  2432. }
  2433. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2434. Self::descriptor_static()
  2435. }
  2436. fn new() -> FingerprintChallengeUnion {
  2437. FingerprintChallengeUnion::new()
  2438. }
  2439. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2440. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  2441. lock: ::protobuf::lazy::ONCE_INIT,
  2442. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  2443. };
  2444. unsafe {
  2445. descriptor.get(|| {
  2446. let mut fields = ::std::vec::Vec::new();
  2447. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<FingerprintGrainChallenge>>(
  2448. "grain",
  2449. |m: &FingerprintChallengeUnion| { &m.grain },
  2450. |m: &mut FingerprintChallengeUnion| { &mut m.grain },
  2451. ));
  2452. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<FingerprintHmacRipemdChallenge>>(
  2453. "hmac_ripemd",
  2454. |m: &FingerprintChallengeUnion| { &m.hmac_ripemd },
  2455. |m: &mut FingerprintChallengeUnion| { &mut m.hmac_ripemd },
  2456. ));
  2457. ::protobuf::reflect::MessageDescriptor::new::<FingerprintChallengeUnion>(
  2458. "FingerprintChallengeUnion",
  2459. fields,
  2460. file_descriptor_proto()
  2461. )
  2462. })
  2463. }
  2464. }
  2465. fn default_instance() -> &'static FingerprintChallengeUnion {
  2466. static mut instance: ::protobuf::lazy::Lazy<FingerprintChallengeUnion> = ::protobuf::lazy::Lazy {
  2467. lock: ::protobuf::lazy::ONCE_INIT,
  2468. ptr: 0 as *const FingerprintChallengeUnion,
  2469. };
  2470. unsafe {
  2471. instance.get(FingerprintChallengeUnion::new)
  2472. }
  2473. }
  2474. }
  2475. impl ::protobuf::Clear for FingerprintChallengeUnion {
  2476. fn clear(&mut self) {
  2477. self.clear_grain();
  2478. self.clear_hmac_ripemd();
  2479. self.unknown_fields.clear();
  2480. }
  2481. }
  2482. impl ::std::fmt::Debug for FingerprintChallengeUnion {
  2483. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  2484. ::protobuf::text_format::fmt(self, f)
  2485. }
  2486. }
  2487. impl ::protobuf::reflect::ProtobufValue for FingerprintChallengeUnion {
  2488. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  2489. ::protobuf::reflect::ProtobufValueRef::Message(self)
  2490. }
  2491. }
  2492. #[derive(PartialEq,Clone,Default)]
  2493. pub struct FingerprintGrainChallenge {
  2494. // message fields
  2495. kek: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2496. // special fields
  2497. unknown_fields: ::protobuf::UnknownFields,
  2498. cached_size: ::protobuf::CachedSize,
  2499. }
  2500. impl FingerprintGrainChallenge {
  2501. pub fn new() -> FingerprintGrainChallenge {
  2502. ::std::default::Default::default()
  2503. }
  2504. // required bytes kek = 10;
  2505. pub fn clear_kek(&mut self) {
  2506. self.kek.clear();
  2507. }
  2508. pub fn has_kek(&self) -> bool {
  2509. self.kek.is_some()
  2510. }
  2511. // Param is passed by value, moved
  2512. pub fn set_kek(&mut self, v: ::std::vec::Vec<u8>) {
  2513. self.kek = ::protobuf::SingularField::some(v);
  2514. }
  2515. // Mutable pointer to the field.
  2516. // If field is not initialized, it is initialized with default value first.
  2517. pub fn mut_kek(&mut self) -> &mut ::std::vec::Vec<u8> {
  2518. if self.kek.is_none() {
  2519. self.kek.set_default();
  2520. }
  2521. self.kek.as_mut().unwrap()
  2522. }
  2523. // Take field
  2524. pub fn take_kek(&mut self) -> ::std::vec::Vec<u8> {
  2525. self.kek.take().unwrap_or_else(|| ::std::vec::Vec::new())
  2526. }
  2527. pub fn get_kek(&self) -> &[u8] {
  2528. match self.kek.as_ref() {
  2529. Some(v) => &v,
  2530. None => &[],
  2531. }
  2532. }
  2533. }
  2534. impl ::protobuf::Message for FingerprintGrainChallenge {
  2535. fn is_initialized(&self) -> bool {
  2536. if self.kek.is_none() {
  2537. return false;
  2538. }
  2539. true
  2540. }
  2541. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  2542. while !is.eof()? {
  2543. let (field_number, wire_type) = is.read_tag_unpack()?;
  2544. match field_number {
  2545. 10 => {
  2546. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.kek)?;
  2547. },
  2548. _ => {
  2549. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  2550. },
  2551. };
  2552. }
  2553. ::std::result::Result::Ok(())
  2554. }
  2555. // Compute sizes of nested messages
  2556. #[allow(unused_variables)]
  2557. fn compute_size(&self) -> u32 {
  2558. let mut my_size = 0;
  2559. if let Some(ref v) = self.kek.as_ref() {
  2560. my_size += ::protobuf::rt::bytes_size(10, &v);
  2561. }
  2562. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2563. self.cached_size.set(my_size);
  2564. my_size
  2565. }
  2566. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  2567. if let Some(ref v) = self.kek.as_ref() {
  2568. os.write_bytes(10, &v)?;
  2569. }
  2570. os.write_unknown_fields(self.get_unknown_fields())?;
  2571. ::std::result::Result::Ok(())
  2572. }
  2573. fn get_cached_size(&self) -> u32 {
  2574. self.cached_size.get()
  2575. }
  2576. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2577. &self.unknown_fields
  2578. }
  2579. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2580. &mut self.unknown_fields
  2581. }
  2582. fn as_any(&self) -> &::std::any::Any {
  2583. self as &::std::any::Any
  2584. }
  2585. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  2586. self as &mut ::std::any::Any
  2587. }
  2588. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  2589. self
  2590. }
  2591. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2592. Self::descriptor_static()
  2593. }
  2594. fn new() -> FingerprintGrainChallenge {
  2595. FingerprintGrainChallenge::new()
  2596. }
  2597. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2598. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  2599. lock: ::protobuf::lazy::ONCE_INIT,
  2600. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  2601. };
  2602. unsafe {
  2603. descriptor.get(|| {
  2604. let mut fields = ::std::vec::Vec::new();
  2605. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  2606. "kek",
  2607. |m: &FingerprintGrainChallenge| { &m.kek },
  2608. |m: &mut FingerprintGrainChallenge| { &mut m.kek },
  2609. ));
  2610. ::protobuf::reflect::MessageDescriptor::new::<FingerprintGrainChallenge>(
  2611. "FingerprintGrainChallenge",
  2612. fields,
  2613. file_descriptor_proto()
  2614. )
  2615. })
  2616. }
  2617. }
  2618. fn default_instance() -> &'static FingerprintGrainChallenge {
  2619. static mut instance: ::protobuf::lazy::Lazy<FingerprintGrainChallenge> = ::protobuf::lazy::Lazy {
  2620. lock: ::protobuf::lazy::ONCE_INIT,
  2621. ptr: 0 as *const FingerprintGrainChallenge,
  2622. };
  2623. unsafe {
  2624. instance.get(FingerprintGrainChallenge::new)
  2625. }
  2626. }
  2627. }
  2628. impl ::protobuf::Clear for FingerprintGrainChallenge {
  2629. fn clear(&mut self) {
  2630. self.clear_kek();
  2631. self.unknown_fields.clear();
  2632. }
  2633. }
  2634. impl ::std::fmt::Debug for FingerprintGrainChallenge {
  2635. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  2636. ::protobuf::text_format::fmt(self, f)
  2637. }
  2638. }
  2639. impl ::protobuf::reflect::ProtobufValue for FingerprintGrainChallenge {
  2640. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  2641. ::protobuf::reflect::ProtobufValueRef::Message(self)
  2642. }
  2643. }
  2644. #[derive(PartialEq,Clone,Default)]
  2645. pub struct FingerprintHmacRipemdChallenge {
  2646. // message fields
  2647. challenge: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2648. // special fields
  2649. unknown_fields: ::protobuf::UnknownFields,
  2650. cached_size: ::protobuf::CachedSize,
  2651. }
  2652. impl FingerprintHmacRipemdChallenge {
  2653. pub fn new() -> FingerprintHmacRipemdChallenge {
  2654. ::std::default::Default::default()
  2655. }
  2656. // required bytes challenge = 10;
  2657. pub fn clear_challenge(&mut self) {
  2658. self.challenge.clear();
  2659. }
  2660. pub fn has_challenge(&self) -> bool {
  2661. self.challenge.is_some()
  2662. }
  2663. // Param is passed by value, moved
  2664. pub fn set_challenge(&mut self, v: ::std::vec::Vec<u8>) {
  2665. self.challenge = ::protobuf::SingularField::some(v);
  2666. }
  2667. // Mutable pointer to the field.
  2668. // If field is not initialized, it is initialized with default value first.
  2669. pub fn mut_challenge(&mut self) -> &mut ::std::vec::Vec<u8> {
  2670. if self.challenge.is_none() {
  2671. self.challenge.set_default();
  2672. }
  2673. self.challenge.as_mut().unwrap()
  2674. }
  2675. // Take field
  2676. pub fn take_challenge(&mut self) -> ::std::vec::Vec<u8> {
  2677. self.challenge.take().unwrap_or_else(|| ::std::vec::Vec::new())
  2678. }
  2679. pub fn get_challenge(&self) -> &[u8] {
  2680. match self.challenge.as_ref() {
  2681. Some(v) => &v,
  2682. None => &[],
  2683. }
  2684. }
  2685. }
  2686. impl ::protobuf::Message for FingerprintHmacRipemdChallenge {
  2687. fn is_initialized(&self) -> bool {
  2688. if self.challenge.is_none() {
  2689. return false;
  2690. }
  2691. true
  2692. }
  2693. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  2694. while !is.eof()? {
  2695. let (field_number, wire_type) = is.read_tag_unpack()?;
  2696. match field_number {
  2697. 10 => {
  2698. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.challenge)?;
  2699. },
  2700. _ => {
  2701. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  2702. },
  2703. };
  2704. }
  2705. ::std::result::Result::Ok(())
  2706. }
  2707. // Compute sizes of nested messages
  2708. #[allow(unused_variables)]
  2709. fn compute_size(&self) -> u32 {
  2710. let mut my_size = 0;
  2711. if let Some(ref v) = self.challenge.as_ref() {
  2712. my_size += ::protobuf::rt::bytes_size(10, &v);
  2713. }
  2714. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2715. self.cached_size.set(my_size);
  2716. my_size
  2717. }
  2718. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  2719. if let Some(ref v) = self.challenge.as_ref() {
  2720. os.write_bytes(10, &v)?;
  2721. }
  2722. os.write_unknown_fields(self.get_unknown_fields())?;
  2723. ::std::result::Result::Ok(())
  2724. }
  2725. fn get_cached_size(&self) -> u32 {
  2726. self.cached_size.get()
  2727. }
  2728. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2729. &self.unknown_fields
  2730. }
  2731. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2732. &mut self.unknown_fields
  2733. }
  2734. fn as_any(&self) -> &::std::any::Any {
  2735. self as &::std::any::Any
  2736. }
  2737. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  2738. self as &mut ::std::any::Any
  2739. }
  2740. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  2741. self
  2742. }
  2743. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2744. Self::descriptor_static()
  2745. }
  2746. fn new() -> FingerprintHmacRipemdChallenge {
  2747. FingerprintHmacRipemdChallenge::new()
  2748. }
  2749. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2750. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  2751. lock: ::protobuf::lazy::ONCE_INIT,
  2752. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  2753. };
  2754. unsafe {
  2755. descriptor.get(|| {
  2756. let mut fields = ::std::vec::Vec::new();
  2757. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  2758. "challenge",
  2759. |m: &FingerprintHmacRipemdChallenge| { &m.challenge },
  2760. |m: &mut FingerprintHmacRipemdChallenge| { &mut m.challenge },
  2761. ));
  2762. ::protobuf::reflect::MessageDescriptor::new::<FingerprintHmacRipemdChallenge>(
  2763. "FingerprintHmacRipemdChallenge",
  2764. fields,
  2765. file_descriptor_proto()
  2766. )
  2767. })
  2768. }
  2769. }
  2770. fn default_instance() -> &'static FingerprintHmacRipemdChallenge {
  2771. static mut instance: ::protobuf::lazy::Lazy<FingerprintHmacRipemdChallenge> = ::protobuf::lazy::Lazy {
  2772. lock: ::protobuf::lazy::ONCE_INIT,
  2773. ptr: 0 as *const FingerprintHmacRipemdChallenge,
  2774. };
  2775. unsafe {
  2776. instance.get(FingerprintHmacRipemdChallenge::new)
  2777. }
  2778. }
  2779. }
  2780. impl ::protobuf::Clear for FingerprintHmacRipemdChallenge {
  2781. fn clear(&mut self) {
  2782. self.clear_challenge();
  2783. self.unknown_fields.clear();
  2784. }
  2785. }
  2786. impl ::std::fmt::Debug for FingerprintHmacRipemdChallenge {
  2787. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  2788. ::protobuf::text_format::fmt(self, f)
  2789. }
  2790. }
  2791. impl ::protobuf::reflect::ProtobufValue for FingerprintHmacRipemdChallenge {
  2792. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  2793. ::protobuf::reflect::ProtobufValueRef::Message(self)
  2794. }
  2795. }
  2796. #[derive(PartialEq,Clone,Default)]
  2797. pub struct PoWChallengeUnion {
  2798. // message fields
  2799. hash_cash: ::protobuf::SingularPtrField<PoWHashCashChallenge>,
  2800. // special fields
  2801. unknown_fields: ::protobuf::UnknownFields,
  2802. cached_size: ::protobuf::CachedSize,
  2803. }
  2804. impl PoWChallengeUnion {
  2805. pub fn new() -> PoWChallengeUnion {
  2806. ::std::default::Default::default()
  2807. }
  2808. // optional .PoWHashCashChallenge hash_cash = 10;
  2809. pub fn clear_hash_cash(&mut self) {
  2810. self.hash_cash.clear();
  2811. }
  2812. pub fn has_hash_cash(&self) -> bool {
  2813. self.hash_cash.is_some()
  2814. }
  2815. // Param is passed by value, moved
  2816. pub fn set_hash_cash(&mut self, v: PoWHashCashChallenge) {
  2817. self.hash_cash = ::protobuf::SingularPtrField::some(v);
  2818. }
  2819. // Mutable pointer to the field.
  2820. // If field is not initialized, it is initialized with default value first.
  2821. pub fn mut_hash_cash(&mut self) -> &mut PoWHashCashChallenge {
  2822. if self.hash_cash.is_none() {
  2823. self.hash_cash.set_default();
  2824. }
  2825. self.hash_cash.as_mut().unwrap()
  2826. }
  2827. // Take field
  2828. pub fn take_hash_cash(&mut self) -> PoWHashCashChallenge {
  2829. self.hash_cash.take().unwrap_or_else(|| PoWHashCashChallenge::new())
  2830. }
  2831. pub fn get_hash_cash(&self) -> &PoWHashCashChallenge {
  2832. self.hash_cash.as_ref().unwrap_or_else(|| PoWHashCashChallenge::default_instance())
  2833. }
  2834. }
  2835. impl ::protobuf::Message for PoWChallengeUnion {
  2836. fn is_initialized(&self) -> bool {
  2837. for v in &self.hash_cash {
  2838. if !v.is_initialized() {
  2839. return false;
  2840. }
  2841. };
  2842. true
  2843. }
  2844. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  2845. while !is.eof()? {
  2846. let (field_number, wire_type) = is.read_tag_unpack()?;
  2847. match field_number {
  2848. 10 => {
  2849. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.hash_cash)?;
  2850. },
  2851. _ => {
  2852. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  2853. },
  2854. };
  2855. }
  2856. ::std::result::Result::Ok(())
  2857. }
  2858. // Compute sizes of nested messages
  2859. #[allow(unused_variables)]
  2860. fn compute_size(&self) -> u32 {
  2861. let mut my_size = 0;
  2862. if let Some(ref v) = self.hash_cash.as_ref() {
  2863. let len = v.compute_size();
  2864. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  2865. }
  2866. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  2867. self.cached_size.set(my_size);
  2868. my_size
  2869. }
  2870. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  2871. if let Some(ref v) = self.hash_cash.as_ref() {
  2872. os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  2873. os.write_raw_varint32(v.get_cached_size())?;
  2874. v.write_to_with_cached_sizes(os)?;
  2875. }
  2876. os.write_unknown_fields(self.get_unknown_fields())?;
  2877. ::std::result::Result::Ok(())
  2878. }
  2879. fn get_cached_size(&self) -> u32 {
  2880. self.cached_size.get()
  2881. }
  2882. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  2883. &self.unknown_fields
  2884. }
  2885. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  2886. &mut self.unknown_fields
  2887. }
  2888. fn as_any(&self) -> &::std::any::Any {
  2889. self as &::std::any::Any
  2890. }
  2891. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  2892. self as &mut ::std::any::Any
  2893. }
  2894. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  2895. self
  2896. }
  2897. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  2898. Self::descriptor_static()
  2899. }
  2900. fn new() -> PoWChallengeUnion {
  2901. PoWChallengeUnion::new()
  2902. }
  2903. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  2904. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  2905. lock: ::protobuf::lazy::ONCE_INIT,
  2906. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  2907. };
  2908. unsafe {
  2909. descriptor.get(|| {
  2910. let mut fields = ::std::vec::Vec::new();
  2911. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<PoWHashCashChallenge>>(
  2912. "hash_cash",
  2913. |m: &PoWChallengeUnion| { &m.hash_cash },
  2914. |m: &mut PoWChallengeUnion| { &mut m.hash_cash },
  2915. ));
  2916. ::protobuf::reflect::MessageDescriptor::new::<PoWChallengeUnion>(
  2917. "PoWChallengeUnion",
  2918. fields,
  2919. file_descriptor_proto()
  2920. )
  2921. })
  2922. }
  2923. }
  2924. fn default_instance() -> &'static PoWChallengeUnion {
  2925. static mut instance: ::protobuf::lazy::Lazy<PoWChallengeUnion> = ::protobuf::lazy::Lazy {
  2926. lock: ::protobuf::lazy::ONCE_INIT,
  2927. ptr: 0 as *const PoWChallengeUnion,
  2928. };
  2929. unsafe {
  2930. instance.get(PoWChallengeUnion::new)
  2931. }
  2932. }
  2933. }
  2934. impl ::protobuf::Clear for PoWChallengeUnion {
  2935. fn clear(&mut self) {
  2936. self.clear_hash_cash();
  2937. self.unknown_fields.clear();
  2938. }
  2939. }
  2940. impl ::std::fmt::Debug for PoWChallengeUnion {
  2941. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  2942. ::protobuf::text_format::fmt(self, f)
  2943. }
  2944. }
  2945. impl ::protobuf::reflect::ProtobufValue for PoWChallengeUnion {
  2946. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  2947. ::protobuf::reflect::ProtobufValueRef::Message(self)
  2948. }
  2949. }
  2950. #[derive(PartialEq,Clone,Default)]
  2951. pub struct PoWHashCashChallenge {
  2952. // message fields
  2953. prefix: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  2954. length: ::std::option::Option<i32>,
  2955. target: ::std::option::Option<i32>,
  2956. // special fields
  2957. unknown_fields: ::protobuf::UnknownFields,
  2958. cached_size: ::protobuf::CachedSize,
  2959. }
  2960. impl PoWHashCashChallenge {
  2961. pub fn new() -> PoWHashCashChallenge {
  2962. ::std::default::Default::default()
  2963. }
  2964. // optional bytes prefix = 10;
  2965. pub fn clear_prefix(&mut self) {
  2966. self.prefix.clear();
  2967. }
  2968. pub fn has_prefix(&self) -> bool {
  2969. self.prefix.is_some()
  2970. }
  2971. // Param is passed by value, moved
  2972. pub fn set_prefix(&mut self, v: ::std::vec::Vec<u8>) {
  2973. self.prefix = ::protobuf::SingularField::some(v);
  2974. }
  2975. // Mutable pointer to the field.
  2976. // If field is not initialized, it is initialized with default value first.
  2977. pub fn mut_prefix(&mut self) -> &mut ::std::vec::Vec<u8> {
  2978. if self.prefix.is_none() {
  2979. self.prefix.set_default();
  2980. }
  2981. self.prefix.as_mut().unwrap()
  2982. }
  2983. // Take field
  2984. pub fn take_prefix(&mut self) -> ::std::vec::Vec<u8> {
  2985. self.prefix.take().unwrap_or_else(|| ::std::vec::Vec::new())
  2986. }
  2987. pub fn get_prefix(&self) -> &[u8] {
  2988. match self.prefix.as_ref() {
  2989. Some(v) => &v,
  2990. None => &[],
  2991. }
  2992. }
  2993. // optional int32 length = 20;
  2994. pub fn clear_length(&mut self) {
  2995. self.length = ::std::option::Option::None;
  2996. }
  2997. pub fn has_length(&self) -> bool {
  2998. self.length.is_some()
  2999. }
  3000. // Param is passed by value, moved
  3001. pub fn set_length(&mut self, v: i32) {
  3002. self.length = ::std::option::Option::Some(v);
  3003. }
  3004. pub fn get_length(&self) -> i32 {
  3005. self.length.unwrap_or(0)
  3006. }
  3007. // optional int32 target = 30;
  3008. pub fn clear_target(&mut self) {
  3009. self.target = ::std::option::Option::None;
  3010. }
  3011. pub fn has_target(&self) -> bool {
  3012. self.target.is_some()
  3013. }
  3014. // Param is passed by value, moved
  3015. pub fn set_target(&mut self, v: i32) {
  3016. self.target = ::std::option::Option::Some(v);
  3017. }
  3018. pub fn get_target(&self) -> i32 {
  3019. self.target.unwrap_or(0)
  3020. }
  3021. }
  3022. impl ::protobuf::Message for PoWHashCashChallenge {
  3023. fn is_initialized(&self) -> bool {
  3024. true
  3025. }
  3026. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  3027. while !is.eof()? {
  3028. let (field_number, wire_type) = is.read_tag_unpack()?;
  3029. match field_number {
  3030. 10 => {
  3031. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.prefix)?;
  3032. },
  3033. 20 => {
  3034. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  3035. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  3036. }
  3037. let tmp = is.read_int32()?;
  3038. self.length = ::std::option::Option::Some(tmp);
  3039. },
  3040. 30 => {
  3041. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  3042. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  3043. }
  3044. let tmp = is.read_int32()?;
  3045. self.target = ::std::option::Option::Some(tmp);
  3046. },
  3047. _ => {
  3048. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  3049. },
  3050. };
  3051. }
  3052. ::std::result::Result::Ok(())
  3053. }
  3054. // Compute sizes of nested messages
  3055. #[allow(unused_variables)]
  3056. fn compute_size(&self) -> u32 {
  3057. let mut my_size = 0;
  3058. if let Some(ref v) = self.prefix.as_ref() {
  3059. my_size += ::protobuf::rt::bytes_size(10, &v);
  3060. }
  3061. if let Some(v) = self.length {
  3062. my_size += ::protobuf::rt::value_size(20, v, ::protobuf::wire_format::WireTypeVarint);
  3063. }
  3064. if let Some(v) = self.target {
  3065. my_size += ::protobuf::rt::value_size(30, v, ::protobuf::wire_format::WireTypeVarint);
  3066. }
  3067. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  3068. self.cached_size.set(my_size);
  3069. my_size
  3070. }
  3071. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  3072. if let Some(ref v) = self.prefix.as_ref() {
  3073. os.write_bytes(10, &v)?;
  3074. }
  3075. if let Some(v) = self.length {
  3076. os.write_int32(20, v)?;
  3077. }
  3078. if let Some(v) = self.target {
  3079. os.write_int32(30, v)?;
  3080. }
  3081. os.write_unknown_fields(self.get_unknown_fields())?;
  3082. ::std::result::Result::Ok(())
  3083. }
  3084. fn get_cached_size(&self) -> u32 {
  3085. self.cached_size.get()
  3086. }
  3087. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  3088. &self.unknown_fields
  3089. }
  3090. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  3091. &mut self.unknown_fields
  3092. }
  3093. fn as_any(&self) -> &::std::any::Any {
  3094. self as &::std::any::Any
  3095. }
  3096. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  3097. self as &mut ::std::any::Any
  3098. }
  3099. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  3100. self
  3101. }
  3102. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  3103. Self::descriptor_static()
  3104. }
  3105. fn new() -> PoWHashCashChallenge {
  3106. PoWHashCashChallenge::new()
  3107. }
  3108. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  3109. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  3110. lock: ::protobuf::lazy::ONCE_INIT,
  3111. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  3112. };
  3113. unsafe {
  3114. descriptor.get(|| {
  3115. let mut fields = ::std::vec::Vec::new();
  3116. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  3117. "prefix",
  3118. |m: &PoWHashCashChallenge| { &m.prefix },
  3119. |m: &mut PoWHashCashChallenge| { &mut m.prefix },
  3120. ));
  3121. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  3122. "length",
  3123. |m: &PoWHashCashChallenge| { &m.length },
  3124. |m: &mut PoWHashCashChallenge| { &mut m.length },
  3125. ));
  3126. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  3127. "target",
  3128. |m: &PoWHashCashChallenge| { &m.target },
  3129. |m: &mut PoWHashCashChallenge| { &mut m.target },
  3130. ));
  3131. ::protobuf::reflect::MessageDescriptor::new::<PoWHashCashChallenge>(
  3132. "PoWHashCashChallenge",
  3133. fields,
  3134. file_descriptor_proto()
  3135. )
  3136. })
  3137. }
  3138. }
  3139. fn default_instance() -> &'static PoWHashCashChallenge {
  3140. static mut instance: ::protobuf::lazy::Lazy<PoWHashCashChallenge> = ::protobuf::lazy::Lazy {
  3141. lock: ::protobuf::lazy::ONCE_INIT,
  3142. ptr: 0 as *const PoWHashCashChallenge,
  3143. };
  3144. unsafe {
  3145. instance.get(PoWHashCashChallenge::new)
  3146. }
  3147. }
  3148. }
  3149. impl ::protobuf::Clear for PoWHashCashChallenge {
  3150. fn clear(&mut self) {
  3151. self.clear_prefix();
  3152. self.clear_length();
  3153. self.clear_target();
  3154. self.unknown_fields.clear();
  3155. }
  3156. }
  3157. impl ::std::fmt::Debug for PoWHashCashChallenge {
  3158. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  3159. ::protobuf::text_format::fmt(self, f)
  3160. }
  3161. }
  3162. impl ::protobuf::reflect::ProtobufValue for PoWHashCashChallenge {
  3163. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  3164. ::protobuf::reflect::ProtobufValueRef::Message(self)
  3165. }
  3166. }
  3167. #[derive(PartialEq,Clone,Default)]
  3168. pub struct CryptoChallengeUnion {
  3169. // message fields
  3170. shannon: ::protobuf::SingularPtrField<CryptoShannonChallenge>,
  3171. rc4_sha1_hmac: ::protobuf::SingularPtrField<CryptoRc4Sha1HmacChallenge>,
  3172. // special fields
  3173. unknown_fields: ::protobuf::UnknownFields,
  3174. cached_size: ::protobuf::CachedSize,
  3175. }
  3176. impl CryptoChallengeUnion {
  3177. pub fn new() -> CryptoChallengeUnion {
  3178. ::std::default::Default::default()
  3179. }
  3180. // optional .CryptoShannonChallenge shannon = 10;
  3181. pub fn clear_shannon(&mut self) {
  3182. self.shannon.clear();
  3183. }
  3184. pub fn has_shannon(&self) -> bool {
  3185. self.shannon.is_some()
  3186. }
  3187. // Param is passed by value, moved
  3188. pub fn set_shannon(&mut self, v: CryptoShannonChallenge) {
  3189. self.shannon = ::protobuf::SingularPtrField::some(v);
  3190. }
  3191. // Mutable pointer to the field.
  3192. // If field is not initialized, it is initialized with default value first.
  3193. pub fn mut_shannon(&mut self) -> &mut CryptoShannonChallenge {
  3194. if self.shannon.is_none() {
  3195. self.shannon.set_default();
  3196. }
  3197. self.shannon.as_mut().unwrap()
  3198. }
  3199. // Take field
  3200. pub fn take_shannon(&mut self) -> CryptoShannonChallenge {
  3201. self.shannon.take().unwrap_or_else(|| CryptoShannonChallenge::new())
  3202. }
  3203. pub fn get_shannon(&self) -> &CryptoShannonChallenge {
  3204. self.shannon.as_ref().unwrap_or_else(|| CryptoShannonChallenge::default_instance())
  3205. }
  3206. // optional .CryptoRc4Sha1HmacChallenge rc4_sha1_hmac = 20;
  3207. pub fn clear_rc4_sha1_hmac(&mut self) {
  3208. self.rc4_sha1_hmac.clear();
  3209. }
  3210. pub fn has_rc4_sha1_hmac(&self) -> bool {
  3211. self.rc4_sha1_hmac.is_some()
  3212. }
  3213. // Param is passed by value, moved
  3214. pub fn set_rc4_sha1_hmac(&mut self, v: CryptoRc4Sha1HmacChallenge) {
  3215. self.rc4_sha1_hmac = ::protobuf::SingularPtrField::some(v);
  3216. }
  3217. // Mutable pointer to the field.
  3218. // If field is not initialized, it is initialized with default value first.
  3219. pub fn mut_rc4_sha1_hmac(&mut self) -> &mut CryptoRc4Sha1HmacChallenge {
  3220. if self.rc4_sha1_hmac.is_none() {
  3221. self.rc4_sha1_hmac.set_default();
  3222. }
  3223. self.rc4_sha1_hmac.as_mut().unwrap()
  3224. }
  3225. // Take field
  3226. pub fn take_rc4_sha1_hmac(&mut self) -> CryptoRc4Sha1HmacChallenge {
  3227. self.rc4_sha1_hmac.take().unwrap_or_else(|| CryptoRc4Sha1HmacChallenge::new())
  3228. }
  3229. pub fn get_rc4_sha1_hmac(&self) -> &CryptoRc4Sha1HmacChallenge {
  3230. self.rc4_sha1_hmac.as_ref().unwrap_or_else(|| CryptoRc4Sha1HmacChallenge::default_instance())
  3231. }
  3232. }
  3233. impl ::protobuf::Message for CryptoChallengeUnion {
  3234. fn is_initialized(&self) -> bool {
  3235. for v in &self.shannon {
  3236. if !v.is_initialized() {
  3237. return false;
  3238. }
  3239. };
  3240. for v in &self.rc4_sha1_hmac {
  3241. if !v.is_initialized() {
  3242. return false;
  3243. }
  3244. };
  3245. true
  3246. }
  3247. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  3248. while !is.eof()? {
  3249. let (field_number, wire_type) = is.read_tag_unpack()?;
  3250. match field_number {
  3251. 10 => {
  3252. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.shannon)?;
  3253. },
  3254. 20 => {
  3255. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.rc4_sha1_hmac)?;
  3256. },
  3257. _ => {
  3258. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  3259. },
  3260. };
  3261. }
  3262. ::std::result::Result::Ok(())
  3263. }
  3264. // Compute sizes of nested messages
  3265. #[allow(unused_variables)]
  3266. fn compute_size(&self) -> u32 {
  3267. let mut my_size = 0;
  3268. if let Some(ref v) = self.shannon.as_ref() {
  3269. let len = v.compute_size();
  3270. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  3271. }
  3272. if let Some(ref v) = self.rc4_sha1_hmac.as_ref() {
  3273. let len = v.compute_size();
  3274. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  3275. }
  3276. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  3277. self.cached_size.set(my_size);
  3278. my_size
  3279. }
  3280. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  3281. if let Some(ref v) = self.shannon.as_ref() {
  3282. os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  3283. os.write_raw_varint32(v.get_cached_size())?;
  3284. v.write_to_with_cached_sizes(os)?;
  3285. }
  3286. if let Some(ref v) = self.rc4_sha1_hmac.as_ref() {
  3287. os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  3288. os.write_raw_varint32(v.get_cached_size())?;
  3289. v.write_to_with_cached_sizes(os)?;
  3290. }
  3291. os.write_unknown_fields(self.get_unknown_fields())?;
  3292. ::std::result::Result::Ok(())
  3293. }
  3294. fn get_cached_size(&self) -> u32 {
  3295. self.cached_size.get()
  3296. }
  3297. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  3298. &self.unknown_fields
  3299. }
  3300. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  3301. &mut self.unknown_fields
  3302. }
  3303. fn as_any(&self) -> &::std::any::Any {
  3304. self as &::std::any::Any
  3305. }
  3306. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  3307. self as &mut ::std::any::Any
  3308. }
  3309. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  3310. self
  3311. }
  3312. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  3313. Self::descriptor_static()
  3314. }
  3315. fn new() -> CryptoChallengeUnion {
  3316. CryptoChallengeUnion::new()
  3317. }
  3318. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  3319. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  3320. lock: ::protobuf::lazy::ONCE_INIT,
  3321. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  3322. };
  3323. unsafe {
  3324. descriptor.get(|| {
  3325. let mut fields = ::std::vec::Vec::new();
  3326. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<CryptoShannonChallenge>>(
  3327. "shannon",
  3328. |m: &CryptoChallengeUnion| { &m.shannon },
  3329. |m: &mut CryptoChallengeUnion| { &mut m.shannon },
  3330. ));
  3331. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<CryptoRc4Sha1HmacChallenge>>(
  3332. "rc4_sha1_hmac",
  3333. |m: &CryptoChallengeUnion| { &m.rc4_sha1_hmac },
  3334. |m: &mut CryptoChallengeUnion| { &mut m.rc4_sha1_hmac },
  3335. ));
  3336. ::protobuf::reflect::MessageDescriptor::new::<CryptoChallengeUnion>(
  3337. "CryptoChallengeUnion",
  3338. fields,
  3339. file_descriptor_proto()
  3340. )
  3341. })
  3342. }
  3343. }
  3344. fn default_instance() -> &'static CryptoChallengeUnion {
  3345. static mut instance: ::protobuf::lazy::Lazy<CryptoChallengeUnion> = ::protobuf::lazy::Lazy {
  3346. lock: ::protobuf::lazy::ONCE_INIT,
  3347. ptr: 0 as *const CryptoChallengeUnion,
  3348. };
  3349. unsafe {
  3350. instance.get(CryptoChallengeUnion::new)
  3351. }
  3352. }
  3353. }
  3354. impl ::protobuf::Clear for CryptoChallengeUnion {
  3355. fn clear(&mut self) {
  3356. self.clear_shannon();
  3357. self.clear_rc4_sha1_hmac();
  3358. self.unknown_fields.clear();
  3359. }
  3360. }
  3361. impl ::std::fmt::Debug for CryptoChallengeUnion {
  3362. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  3363. ::protobuf::text_format::fmt(self, f)
  3364. }
  3365. }
  3366. impl ::protobuf::reflect::ProtobufValue for CryptoChallengeUnion {
  3367. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  3368. ::protobuf::reflect::ProtobufValueRef::Message(self)
  3369. }
  3370. }
  3371. #[derive(PartialEq,Clone,Default)]
  3372. pub struct CryptoShannonChallenge {
  3373. // special fields
  3374. unknown_fields: ::protobuf::UnknownFields,
  3375. cached_size: ::protobuf::CachedSize,
  3376. }
  3377. impl CryptoShannonChallenge {
  3378. pub fn new() -> CryptoShannonChallenge {
  3379. ::std::default::Default::default()
  3380. }
  3381. }
  3382. impl ::protobuf::Message for CryptoShannonChallenge {
  3383. fn is_initialized(&self) -> bool {
  3384. true
  3385. }
  3386. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  3387. while !is.eof()? {
  3388. let (field_number, wire_type) = is.read_tag_unpack()?;
  3389. match field_number {
  3390. _ => {
  3391. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  3392. },
  3393. };
  3394. }
  3395. ::std::result::Result::Ok(())
  3396. }
  3397. // Compute sizes of nested messages
  3398. #[allow(unused_variables)]
  3399. fn compute_size(&self) -> u32 {
  3400. let mut my_size = 0;
  3401. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  3402. self.cached_size.set(my_size);
  3403. my_size
  3404. }
  3405. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  3406. os.write_unknown_fields(self.get_unknown_fields())?;
  3407. ::std::result::Result::Ok(())
  3408. }
  3409. fn get_cached_size(&self) -> u32 {
  3410. self.cached_size.get()
  3411. }
  3412. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  3413. &self.unknown_fields
  3414. }
  3415. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  3416. &mut self.unknown_fields
  3417. }
  3418. fn as_any(&self) -> &::std::any::Any {
  3419. self as &::std::any::Any
  3420. }
  3421. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  3422. self as &mut ::std::any::Any
  3423. }
  3424. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  3425. self
  3426. }
  3427. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  3428. Self::descriptor_static()
  3429. }
  3430. fn new() -> CryptoShannonChallenge {
  3431. CryptoShannonChallenge::new()
  3432. }
  3433. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  3434. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  3435. lock: ::protobuf::lazy::ONCE_INIT,
  3436. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  3437. };
  3438. unsafe {
  3439. descriptor.get(|| {
  3440. let fields = ::std::vec::Vec::new();
  3441. ::protobuf::reflect::MessageDescriptor::new::<CryptoShannonChallenge>(
  3442. "CryptoShannonChallenge",
  3443. fields,
  3444. file_descriptor_proto()
  3445. )
  3446. })
  3447. }
  3448. }
  3449. fn default_instance() -> &'static CryptoShannonChallenge {
  3450. static mut instance: ::protobuf::lazy::Lazy<CryptoShannonChallenge> = ::protobuf::lazy::Lazy {
  3451. lock: ::protobuf::lazy::ONCE_INIT,
  3452. ptr: 0 as *const CryptoShannonChallenge,
  3453. };
  3454. unsafe {
  3455. instance.get(CryptoShannonChallenge::new)
  3456. }
  3457. }
  3458. }
  3459. impl ::protobuf::Clear for CryptoShannonChallenge {
  3460. fn clear(&mut self) {
  3461. self.unknown_fields.clear();
  3462. }
  3463. }
  3464. impl ::std::fmt::Debug for CryptoShannonChallenge {
  3465. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  3466. ::protobuf::text_format::fmt(self, f)
  3467. }
  3468. }
  3469. impl ::protobuf::reflect::ProtobufValue for CryptoShannonChallenge {
  3470. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  3471. ::protobuf::reflect::ProtobufValueRef::Message(self)
  3472. }
  3473. }
  3474. #[derive(PartialEq,Clone,Default)]
  3475. pub struct CryptoRc4Sha1HmacChallenge {
  3476. // special fields
  3477. unknown_fields: ::protobuf::UnknownFields,
  3478. cached_size: ::protobuf::CachedSize,
  3479. }
  3480. impl CryptoRc4Sha1HmacChallenge {
  3481. pub fn new() -> CryptoRc4Sha1HmacChallenge {
  3482. ::std::default::Default::default()
  3483. }
  3484. }
  3485. impl ::protobuf::Message for CryptoRc4Sha1HmacChallenge {
  3486. fn is_initialized(&self) -> bool {
  3487. true
  3488. }
  3489. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  3490. while !is.eof()? {
  3491. let (field_number, wire_type) = is.read_tag_unpack()?;
  3492. match field_number {
  3493. _ => {
  3494. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  3495. },
  3496. };
  3497. }
  3498. ::std::result::Result::Ok(())
  3499. }
  3500. // Compute sizes of nested messages
  3501. #[allow(unused_variables)]
  3502. fn compute_size(&self) -> u32 {
  3503. let mut my_size = 0;
  3504. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  3505. self.cached_size.set(my_size);
  3506. my_size
  3507. }
  3508. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  3509. os.write_unknown_fields(self.get_unknown_fields())?;
  3510. ::std::result::Result::Ok(())
  3511. }
  3512. fn get_cached_size(&self) -> u32 {
  3513. self.cached_size.get()
  3514. }
  3515. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  3516. &self.unknown_fields
  3517. }
  3518. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  3519. &mut self.unknown_fields
  3520. }
  3521. fn as_any(&self) -> &::std::any::Any {
  3522. self as &::std::any::Any
  3523. }
  3524. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  3525. self as &mut ::std::any::Any
  3526. }
  3527. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  3528. self
  3529. }
  3530. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  3531. Self::descriptor_static()
  3532. }
  3533. fn new() -> CryptoRc4Sha1HmacChallenge {
  3534. CryptoRc4Sha1HmacChallenge::new()
  3535. }
  3536. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  3537. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  3538. lock: ::protobuf::lazy::ONCE_INIT,
  3539. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  3540. };
  3541. unsafe {
  3542. descriptor.get(|| {
  3543. let fields = ::std::vec::Vec::new();
  3544. ::protobuf::reflect::MessageDescriptor::new::<CryptoRc4Sha1HmacChallenge>(
  3545. "CryptoRc4Sha1HmacChallenge",
  3546. fields,
  3547. file_descriptor_proto()
  3548. )
  3549. })
  3550. }
  3551. }
  3552. fn default_instance() -> &'static CryptoRc4Sha1HmacChallenge {
  3553. static mut instance: ::protobuf::lazy::Lazy<CryptoRc4Sha1HmacChallenge> = ::protobuf::lazy::Lazy {
  3554. lock: ::protobuf::lazy::ONCE_INIT,
  3555. ptr: 0 as *const CryptoRc4Sha1HmacChallenge,
  3556. };
  3557. unsafe {
  3558. instance.get(CryptoRc4Sha1HmacChallenge::new)
  3559. }
  3560. }
  3561. }
  3562. impl ::protobuf::Clear for CryptoRc4Sha1HmacChallenge {
  3563. fn clear(&mut self) {
  3564. self.unknown_fields.clear();
  3565. }
  3566. }
  3567. impl ::std::fmt::Debug for CryptoRc4Sha1HmacChallenge {
  3568. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  3569. ::protobuf::text_format::fmt(self, f)
  3570. }
  3571. }
  3572. impl ::protobuf::reflect::ProtobufValue for CryptoRc4Sha1HmacChallenge {
  3573. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  3574. ::protobuf::reflect::ProtobufValueRef::Message(self)
  3575. }
  3576. }
  3577. #[derive(PartialEq,Clone,Default)]
  3578. pub struct UpgradeRequiredMessage {
  3579. // message fields
  3580. upgrade_signed_part: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  3581. signature: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  3582. http_suffix: ::protobuf::SingularField<::std::string::String>,
  3583. // special fields
  3584. unknown_fields: ::protobuf::UnknownFields,
  3585. cached_size: ::protobuf::CachedSize,
  3586. }
  3587. impl UpgradeRequiredMessage {
  3588. pub fn new() -> UpgradeRequiredMessage {
  3589. ::std::default::Default::default()
  3590. }
  3591. // required bytes upgrade_signed_part = 10;
  3592. pub fn clear_upgrade_signed_part(&mut self) {
  3593. self.upgrade_signed_part.clear();
  3594. }
  3595. pub fn has_upgrade_signed_part(&self) -> bool {
  3596. self.upgrade_signed_part.is_some()
  3597. }
  3598. // Param is passed by value, moved
  3599. pub fn set_upgrade_signed_part(&mut self, v: ::std::vec::Vec<u8>) {
  3600. self.upgrade_signed_part = ::protobuf::SingularField::some(v);
  3601. }
  3602. // Mutable pointer to the field.
  3603. // If field is not initialized, it is initialized with default value first.
  3604. pub fn mut_upgrade_signed_part(&mut self) -> &mut ::std::vec::Vec<u8> {
  3605. if self.upgrade_signed_part.is_none() {
  3606. self.upgrade_signed_part.set_default();
  3607. }
  3608. self.upgrade_signed_part.as_mut().unwrap()
  3609. }
  3610. // Take field
  3611. pub fn take_upgrade_signed_part(&mut self) -> ::std::vec::Vec<u8> {
  3612. self.upgrade_signed_part.take().unwrap_or_else(|| ::std::vec::Vec::new())
  3613. }
  3614. pub fn get_upgrade_signed_part(&self) -> &[u8] {
  3615. match self.upgrade_signed_part.as_ref() {
  3616. Some(v) => &v,
  3617. None => &[],
  3618. }
  3619. }
  3620. // required bytes signature = 20;
  3621. pub fn clear_signature(&mut self) {
  3622. self.signature.clear();
  3623. }
  3624. pub fn has_signature(&self) -> bool {
  3625. self.signature.is_some()
  3626. }
  3627. // Param is passed by value, moved
  3628. pub fn set_signature(&mut self, v: ::std::vec::Vec<u8>) {
  3629. self.signature = ::protobuf::SingularField::some(v);
  3630. }
  3631. // Mutable pointer to the field.
  3632. // If field is not initialized, it is initialized with default value first.
  3633. pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec<u8> {
  3634. if self.signature.is_none() {
  3635. self.signature.set_default();
  3636. }
  3637. self.signature.as_mut().unwrap()
  3638. }
  3639. // Take field
  3640. pub fn take_signature(&mut self) -> ::std::vec::Vec<u8> {
  3641. self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new())
  3642. }
  3643. pub fn get_signature(&self) -> &[u8] {
  3644. match self.signature.as_ref() {
  3645. Some(v) => &v,
  3646. None => &[],
  3647. }
  3648. }
  3649. // optional string http_suffix = 30;
  3650. pub fn clear_http_suffix(&mut self) {
  3651. self.http_suffix.clear();
  3652. }
  3653. pub fn has_http_suffix(&self) -> bool {
  3654. self.http_suffix.is_some()
  3655. }
  3656. // Param is passed by value, moved
  3657. pub fn set_http_suffix(&mut self, v: ::std::string::String) {
  3658. self.http_suffix = ::protobuf::SingularField::some(v);
  3659. }
  3660. // Mutable pointer to the field.
  3661. // If field is not initialized, it is initialized with default value first.
  3662. pub fn mut_http_suffix(&mut self) -> &mut ::std::string::String {
  3663. if self.http_suffix.is_none() {
  3664. self.http_suffix.set_default();
  3665. }
  3666. self.http_suffix.as_mut().unwrap()
  3667. }
  3668. // Take field
  3669. pub fn take_http_suffix(&mut self) -> ::std::string::String {
  3670. self.http_suffix.take().unwrap_or_else(|| ::std::string::String::new())
  3671. }
  3672. pub fn get_http_suffix(&self) -> &str {
  3673. match self.http_suffix.as_ref() {
  3674. Some(v) => &v,
  3675. None => "",
  3676. }
  3677. }
  3678. }
  3679. impl ::protobuf::Message for UpgradeRequiredMessage {
  3680. fn is_initialized(&self) -> bool {
  3681. if self.upgrade_signed_part.is_none() {
  3682. return false;
  3683. }
  3684. if self.signature.is_none() {
  3685. return false;
  3686. }
  3687. true
  3688. }
  3689. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  3690. while !is.eof()? {
  3691. let (field_number, wire_type) = is.read_tag_unpack()?;
  3692. match field_number {
  3693. 10 => {
  3694. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.upgrade_signed_part)?;
  3695. },
  3696. 20 => {
  3697. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.signature)?;
  3698. },
  3699. 30 => {
  3700. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.http_suffix)?;
  3701. },
  3702. _ => {
  3703. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  3704. },
  3705. };
  3706. }
  3707. ::std::result::Result::Ok(())
  3708. }
  3709. // Compute sizes of nested messages
  3710. #[allow(unused_variables)]
  3711. fn compute_size(&self) -> u32 {
  3712. let mut my_size = 0;
  3713. if let Some(ref v) = self.upgrade_signed_part.as_ref() {
  3714. my_size += ::protobuf::rt::bytes_size(10, &v);
  3715. }
  3716. if let Some(ref v) = self.signature.as_ref() {
  3717. my_size += ::protobuf::rt::bytes_size(20, &v);
  3718. }
  3719. if let Some(ref v) = self.http_suffix.as_ref() {
  3720. my_size += ::protobuf::rt::string_size(30, &v);
  3721. }
  3722. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  3723. self.cached_size.set(my_size);
  3724. my_size
  3725. }
  3726. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  3727. if let Some(ref v) = self.upgrade_signed_part.as_ref() {
  3728. os.write_bytes(10, &v)?;
  3729. }
  3730. if let Some(ref v) = self.signature.as_ref() {
  3731. os.write_bytes(20, &v)?;
  3732. }
  3733. if let Some(ref v) = self.http_suffix.as_ref() {
  3734. os.write_string(30, &v)?;
  3735. }
  3736. os.write_unknown_fields(self.get_unknown_fields())?;
  3737. ::std::result::Result::Ok(())
  3738. }
  3739. fn get_cached_size(&self) -> u32 {
  3740. self.cached_size.get()
  3741. }
  3742. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  3743. &self.unknown_fields
  3744. }
  3745. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  3746. &mut self.unknown_fields
  3747. }
  3748. fn as_any(&self) -> &::std::any::Any {
  3749. self as &::std::any::Any
  3750. }
  3751. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  3752. self as &mut ::std::any::Any
  3753. }
  3754. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  3755. self
  3756. }
  3757. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  3758. Self::descriptor_static()
  3759. }
  3760. fn new() -> UpgradeRequiredMessage {
  3761. UpgradeRequiredMessage::new()
  3762. }
  3763. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  3764. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  3765. lock: ::protobuf::lazy::ONCE_INIT,
  3766. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  3767. };
  3768. unsafe {
  3769. descriptor.get(|| {
  3770. let mut fields = ::std::vec::Vec::new();
  3771. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  3772. "upgrade_signed_part",
  3773. |m: &UpgradeRequiredMessage| { &m.upgrade_signed_part },
  3774. |m: &mut UpgradeRequiredMessage| { &mut m.upgrade_signed_part },
  3775. ));
  3776. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  3777. "signature",
  3778. |m: &UpgradeRequiredMessage| { &m.signature },
  3779. |m: &mut UpgradeRequiredMessage| { &mut m.signature },
  3780. ));
  3781. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  3782. "http_suffix",
  3783. |m: &UpgradeRequiredMessage| { &m.http_suffix },
  3784. |m: &mut UpgradeRequiredMessage| { &mut m.http_suffix },
  3785. ));
  3786. ::protobuf::reflect::MessageDescriptor::new::<UpgradeRequiredMessage>(
  3787. "UpgradeRequiredMessage",
  3788. fields,
  3789. file_descriptor_proto()
  3790. )
  3791. })
  3792. }
  3793. }
  3794. fn default_instance() -> &'static UpgradeRequiredMessage {
  3795. static mut instance: ::protobuf::lazy::Lazy<UpgradeRequiredMessage> = ::protobuf::lazy::Lazy {
  3796. lock: ::protobuf::lazy::ONCE_INIT,
  3797. ptr: 0 as *const UpgradeRequiredMessage,
  3798. };
  3799. unsafe {
  3800. instance.get(UpgradeRequiredMessage::new)
  3801. }
  3802. }
  3803. }
  3804. impl ::protobuf::Clear for UpgradeRequiredMessage {
  3805. fn clear(&mut self) {
  3806. self.clear_upgrade_signed_part();
  3807. self.clear_signature();
  3808. self.clear_http_suffix();
  3809. self.unknown_fields.clear();
  3810. }
  3811. }
  3812. impl ::std::fmt::Debug for UpgradeRequiredMessage {
  3813. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  3814. ::protobuf::text_format::fmt(self, f)
  3815. }
  3816. }
  3817. impl ::protobuf::reflect::ProtobufValue for UpgradeRequiredMessage {
  3818. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  3819. ::protobuf::reflect::ProtobufValueRef::Message(self)
  3820. }
  3821. }
  3822. #[derive(PartialEq,Clone,Default)]
  3823. pub struct APLoginFailed {
  3824. // message fields
  3825. error_code: ::std::option::Option<ErrorCode>,
  3826. retry_delay: ::std::option::Option<i32>,
  3827. expiry: ::std::option::Option<i32>,
  3828. error_description: ::protobuf::SingularField<::std::string::String>,
  3829. // special fields
  3830. unknown_fields: ::protobuf::UnknownFields,
  3831. cached_size: ::protobuf::CachedSize,
  3832. }
  3833. impl APLoginFailed {
  3834. pub fn new() -> APLoginFailed {
  3835. ::std::default::Default::default()
  3836. }
  3837. // required .ErrorCode error_code = 10;
  3838. pub fn clear_error_code(&mut self) {
  3839. self.error_code = ::std::option::Option::None;
  3840. }
  3841. pub fn has_error_code(&self) -> bool {
  3842. self.error_code.is_some()
  3843. }
  3844. // Param is passed by value, moved
  3845. pub fn set_error_code(&mut self, v: ErrorCode) {
  3846. self.error_code = ::std::option::Option::Some(v);
  3847. }
  3848. pub fn get_error_code(&self) -> ErrorCode {
  3849. self.error_code.unwrap_or(ErrorCode::ProtocolError)
  3850. }
  3851. // optional int32 retry_delay = 20;
  3852. pub fn clear_retry_delay(&mut self) {
  3853. self.retry_delay = ::std::option::Option::None;
  3854. }
  3855. pub fn has_retry_delay(&self) -> bool {
  3856. self.retry_delay.is_some()
  3857. }
  3858. // Param is passed by value, moved
  3859. pub fn set_retry_delay(&mut self, v: i32) {
  3860. self.retry_delay = ::std::option::Option::Some(v);
  3861. }
  3862. pub fn get_retry_delay(&self) -> i32 {
  3863. self.retry_delay.unwrap_or(0)
  3864. }
  3865. // optional int32 expiry = 30;
  3866. pub fn clear_expiry(&mut self) {
  3867. self.expiry = ::std::option::Option::None;
  3868. }
  3869. pub fn has_expiry(&self) -> bool {
  3870. self.expiry.is_some()
  3871. }
  3872. // Param is passed by value, moved
  3873. pub fn set_expiry(&mut self, v: i32) {
  3874. self.expiry = ::std::option::Option::Some(v);
  3875. }
  3876. pub fn get_expiry(&self) -> i32 {
  3877. self.expiry.unwrap_or(0)
  3878. }
  3879. // optional string error_description = 40;
  3880. pub fn clear_error_description(&mut self) {
  3881. self.error_description.clear();
  3882. }
  3883. pub fn has_error_description(&self) -> bool {
  3884. self.error_description.is_some()
  3885. }
  3886. // Param is passed by value, moved
  3887. pub fn set_error_description(&mut self, v: ::std::string::String) {
  3888. self.error_description = ::protobuf::SingularField::some(v);
  3889. }
  3890. // Mutable pointer to the field.
  3891. // If field is not initialized, it is initialized with default value first.
  3892. pub fn mut_error_description(&mut self) -> &mut ::std::string::String {
  3893. if self.error_description.is_none() {
  3894. self.error_description.set_default();
  3895. }
  3896. self.error_description.as_mut().unwrap()
  3897. }
  3898. // Take field
  3899. pub fn take_error_description(&mut self) -> ::std::string::String {
  3900. self.error_description.take().unwrap_or_else(|| ::std::string::String::new())
  3901. }
  3902. pub fn get_error_description(&self) -> &str {
  3903. match self.error_description.as_ref() {
  3904. Some(v) => &v,
  3905. None => "",
  3906. }
  3907. }
  3908. }
  3909. impl ::protobuf::Message for APLoginFailed {
  3910. fn is_initialized(&self) -> bool {
  3911. if self.error_code.is_none() {
  3912. return false;
  3913. }
  3914. true
  3915. }
  3916. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  3917. while !is.eof()? {
  3918. let (field_number, wire_type) = is.read_tag_unpack()?;
  3919. match field_number {
  3920. 10 => {
  3921. ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.error_code, 10, &mut self.unknown_fields)?
  3922. },
  3923. 20 => {
  3924. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  3925. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  3926. }
  3927. let tmp = is.read_int32()?;
  3928. self.retry_delay = ::std::option::Option::Some(tmp);
  3929. },
  3930. 30 => {
  3931. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  3932. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  3933. }
  3934. let tmp = is.read_int32()?;
  3935. self.expiry = ::std::option::Option::Some(tmp);
  3936. },
  3937. 40 => {
  3938. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.error_description)?;
  3939. },
  3940. _ => {
  3941. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  3942. },
  3943. };
  3944. }
  3945. ::std::result::Result::Ok(())
  3946. }
  3947. // Compute sizes of nested messages
  3948. #[allow(unused_variables)]
  3949. fn compute_size(&self) -> u32 {
  3950. let mut my_size = 0;
  3951. if let Some(v) = self.error_code {
  3952. my_size += ::protobuf::rt::enum_size(10, v);
  3953. }
  3954. if let Some(v) = self.retry_delay {
  3955. my_size += ::protobuf::rt::value_size(20, v, ::protobuf::wire_format::WireTypeVarint);
  3956. }
  3957. if let Some(v) = self.expiry {
  3958. my_size += ::protobuf::rt::value_size(30, v, ::protobuf::wire_format::WireTypeVarint);
  3959. }
  3960. if let Some(ref v) = self.error_description.as_ref() {
  3961. my_size += ::protobuf::rt::string_size(40, &v);
  3962. }
  3963. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  3964. self.cached_size.set(my_size);
  3965. my_size
  3966. }
  3967. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  3968. if let Some(v) = self.error_code {
  3969. os.write_enum(10, v.value())?;
  3970. }
  3971. if let Some(v) = self.retry_delay {
  3972. os.write_int32(20, v)?;
  3973. }
  3974. if let Some(v) = self.expiry {
  3975. os.write_int32(30, v)?;
  3976. }
  3977. if let Some(ref v) = self.error_description.as_ref() {
  3978. os.write_string(40, &v)?;
  3979. }
  3980. os.write_unknown_fields(self.get_unknown_fields())?;
  3981. ::std::result::Result::Ok(())
  3982. }
  3983. fn get_cached_size(&self) -> u32 {
  3984. self.cached_size.get()
  3985. }
  3986. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  3987. &self.unknown_fields
  3988. }
  3989. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  3990. &mut self.unknown_fields
  3991. }
  3992. fn as_any(&self) -> &::std::any::Any {
  3993. self as &::std::any::Any
  3994. }
  3995. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  3996. self as &mut ::std::any::Any
  3997. }
  3998. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  3999. self
  4000. }
  4001. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  4002. Self::descriptor_static()
  4003. }
  4004. fn new() -> APLoginFailed {
  4005. APLoginFailed::new()
  4006. }
  4007. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  4008. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  4009. lock: ::protobuf::lazy::ONCE_INIT,
  4010. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  4011. };
  4012. unsafe {
  4013. descriptor.get(|| {
  4014. let mut fields = ::std::vec::Vec::new();
  4015. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ErrorCode>>(
  4016. "error_code",
  4017. |m: &APLoginFailed| { &m.error_code },
  4018. |m: &mut APLoginFailed| { &mut m.error_code },
  4019. ));
  4020. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  4021. "retry_delay",
  4022. |m: &APLoginFailed| { &m.retry_delay },
  4023. |m: &mut APLoginFailed| { &mut m.retry_delay },
  4024. ));
  4025. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  4026. "expiry",
  4027. |m: &APLoginFailed| { &m.expiry },
  4028. |m: &mut APLoginFailed| { &mut m.expiry },
  4029. ));
  4030. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  4031. "error_description",
  4032. |m: &APLoginFailed| { &m.error_description },
  4033. |m: &mut APLoginFailed| { &mut m.error_description },
  4034. ));
  4035. ::protobuf::reflect::MessageDescriptor::new::<APLoginFailed>(
  4036. "APLoginFailed",
  4037. fields,
  4038. file_descriptor_proto()
  4039. )
  4040. })
  4041. }
  4042. }
  4043. fn default_instance() -> &'static APLoginFailed {
  4044. static mut instance: ::protobuf::lazy::Lazy<APLoginFailed> = ::protobuf::lazy::Lazy {
  4045. lock: ::protobuf::lazy::ONCE_INIT,
  4046. ptr: 0 as *const APLoginFailed,
  4047. };
  4048. unsafe {
  4049. instance.get(APLoginFailed::new)
  4050. }
  4051. }
  4052. }
  4053. impl ::protobuf::Clear for APLoginFailed {
  4054. fn clear(&mut self) {
  4055. self.clear_error_code();
  4056. self.clear_retry_delay();
  4057. self.clear_expiry();
  4058. self.clear_error_description();
  4059. self.unknown_fields.clear();
  4060. }
  4061. }
  4062. impl ::std::fmt::Debug for APLoginFailed {
  4063. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  4064. ::protobuf::text_format::fmt(self, f)
  4065. }
  4066. }
  4067. impl ::protobuf::reflect::ProtobufValue for APLoginFailed {
  4068. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  4069. ::protobuf::reflect::ProtobufValueRef::Message(self)
  4070. }
  4071. }
  4072. #[derive(PartialEq,Clone,Default)]
  4073. pub struct ClientResponsePlaintext {
  4074. // message fields
  4075. login_crypto_response: ::protobuf::SingularPtrField<LoginCryptoResponseUnion>,
  4076. pow_response: ::protobuf::SingularPtrField<PoWResponseUnion>,
  4077. crypto_response: ::protobuf::SingularPtrField<CryptoResponseUnion>,
  4078. // special fields
  4079. unknown_fields: ::protobuf::UnknownFields,
  4080. cached_size: ::protobuf::CachedSize,
  4081. }
  4082. impl ClientResponsePlaintext {
  4083. pub fn new() -> ClientResponsePlaintext {
  4084. ::std::default::Default::default()
  4085. }
  4086. // required .LoginCryptoResponseUnion login_crypto_response = 10;
  4087. pub fn clear_login_crypto_response(&mut self) {
  4088. self.login_crypto_response.clear();
  4089. }
  4090. pub fn has_login_crypto_response(&self) -> bool {
  4091. self.login_crypto_response.is_some()
  4092. }
  4093. // Param is passed by value, moved
  4094. pub fn set_login_crypto_response(&mut self, v: LoginCryptoResponseUnion) {
  4095. self.login_crypto_response = ::protobuf::SingularPtrField::some(v);
  4096. }
  4097. // Mutable pointer to the field.
  4098. // If field is not initialized, it is initialized with default value first.
  4099. pub fn mut_login_crypto_response(&mut self) -> &mut LoginCryptoResponseUnion {
  4100. if self.login_crypto_response.is_none() {
  4101. self.login_crypto_response.set_default();
  4102. }
  4103. self.login_crypto_response.as_mut().unwrap()
  4104. }
  4105. // Take field
  4106. pub fn take_login_crypto_response(&mut self) -> LoginCryptoResponseUnion {
  4107. self.login_crypto_response.take().unwrap_or_else(|| LoginCryptoResponseUnion::new())
  4108. }
  4109. pub fn get_login_crypto_response(&self) -> &LoginCryptoResponseUnion {
  4110. self.login_crypto_response.as_ref().unwrap_or_else(|| LoginCryptoResponseUnion::default_instance())
  4111. }
  4112. // required .PoWResponseUnion pow_response = 20;
  4113. pub fn clear_pow_response(&mut self) {
  4114. self.pow_response.clear();
  4115. }
  4116. pub fn has_pow_response(&self) -> bool {
  4117. self.pow_response.is_some()
  4118. }
  4119. // Param is passed by value, moved
  4120. pub fn set_pow_response(&mut self, v: PoWResponseUnion) {
  4121. self.pow_response = ::protobuf::SingularPtrField::some(v);
  4122. }
  4123. // Mutable pointer to the field.
  4124. // If field is not initialized, it is initialized with default value first.
  4125. pub fn mut_pow_response(&mut self) -> &mut PoWResponseUnion {
  4126. if self.pow_response.is_none() {
  4127. self.pow_response.set_default();
  4128. }
  4129. self.pow_response.as_mut().unwrap()
  4130. }
  4131. // Take field
  4132. pub fn take_pow_response(&mut self) -> PoWResponseUnion {
  4133. self.pow_response.take().unwrap_or_else(|| PoWResponseUnion::new())
  4134. }
  4135. pub fn get_pow_response(&self) -> &PoWResponseUnion {
  4136. self.pow_response.as_ref().unwrap_or_else(|| PoWResponseUnion::default_instance())
  4137. }
  4138. // required .CryptoResponseUnion crypto_response = 30;
  4139. pub fn clear_crypto_response(&mut self) {
  4140. self.crypto_response.clear();
  4141. }
  4142. pub fn has_crypto_response(&self) -> bool {
  4143. self.crypto_response.is_some()
  4144. }
  4145. // Param is passed by value, moved
  4146. pub fn set_crypto_response(&mut self, v: CryptoResponseUnion) {
  4147. self.crypto_response = ::protobuf::SingularPtrField::some(v);
  4148. }
  4149. // Mutable pointer to the field.
  4150. // If field is not initialized, it is initialized with default value first.
  4151. pub fn mut_crypto_response(&mut self) -> &mut CryptoResponseUnion {
  4152. if self.crypto_response.is_none() {
  4153. self.crypto_response.set_default();
  4154. }
  4155. self.crypto_response.as_mut().unwrap()
  4156. }
  4157. // Take field
  4158. pub fn take_crypto_response(&mut self) -> CryptoResponseUnion {
  4159. self.crypto_response.take().unwrap_or_else(|| CryptoResponseUnion::new())
  4160. }
  4161. pub fn get_crypto_response(&self) -> &CryptoResponseUnion {
  4162. self.crypto_response.as_ref().unwrap_or_else(|| CryptoResponseUnion::default_instance())
  4163. }
  4164. }
  4165. impl ::protobuf::Message for ClientResponsePlaintext {
  4166. fn is_initialized(&self) -> bool {
  4167. if self.login_crypto_response.is_none() {
  4168. return false;
  4169. }
  4170. if self.pow_response.is_none() {
  4171. return false;
  4172. }
  4173. if self.crypto_response.is_none() {
  4174. return false;
  4175. }
  4176. for v in &self.login_crypto_response {
  4177. if !v.is_initialized() {
  4178. return false;
  4179. }
  4180. };
  4181. for v in &self.pow_response {
  4182. if !v.is_initialized() {
  4183. return false;
  4184. }
  4185. };
  4186. for v in &self.crypto_response {
  4187. if !v.is_initialized() {
  4188. return false;
  4189. }
  4190. };
  4191. true
  4192. }
  4193. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  4194. while !is.eof()? {
  4195. let (field_number, wire_type) = is.read_tag_unpack()?;
  4196. match field_number {
  4197. 10 => {
  4198. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_crypto_response)?;
  4199. },
  4200. 20 => {
  4201. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.pow_response)?;
  4202. },
  4203. 30 => {
  4204. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.crypto_response)?;
  4205. },
  4206. _ => {
  4207. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  4208. },
  4209. };
  4210. }
  4211. ::std::result::Result::Ok(())
  4212. }
  4213. // Compute sizes of nested messages
  4214. #[allow(unused_variables)]
  4215. fn compute_size(&self) -> u32 {
  4216. let mut my_size = 0;
  4217. if let Some(ref v) = self.login_crypto_response.as_ref() {
  4218. let len = v.compute_size();
  4219. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  4220. }
  4221. if let Some(ref v) = self.pow_response.as_ref() {
  4222. let len = v.compute_size();
  4223. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  4224. }
  4225. if let Some(ref v) = self.crypto_response.as_ref() {
  4226. let len = v.compute_size();
  4227. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  4228. }
  4229. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  4230. self.cached_size.set(my_size);
  4231. my_size
  4232. }
  4233. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  4234. if let Some(ref v) = self.login_crypto_response.as_ref() {
  4235. os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  4236. os.write_raw_varint32(v.get_cached_size())?;
  4237. v.write_to_with_cached_sizes(os)?;
  4238. }
  4239. if let Some(ref v) = self.pow_response.as_ref() {
  4240. os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  4241. os.write_raw_varint32(v.get_cached_size())?;
  4242. v.write_to_with_cached_sizes(os)?;
  4243. }
  4244. if let Some(ref v) = self.crypto_response.as_ref() {
  4245. os.write_tag(30, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  4246. os.write_raw_varint32(v.get_cached_size())?;
  4247. v.write_to_with_cached_sizes(os)?;
  4248. }
  4249. os.write_unknown_fields(self.get_unknown_fields())?;
  4250. ::std::result::Result::Ok(())
  4251. }
  4252. fn get_cached_size(&self) -> u32 {
  4253. self.cached_size.get()
  4254. }
  4255. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  4256. &self.unknown_fields
  4257. }
  4258. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  4259. &mut self.unknown_fields
  4260. }
  4261. fn as_any(&self) -> &::std::any::Any {
  4262. self as &::std::any::Any
  4263. }
  4264. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  4265. self as &mut ::std::any::Any
  4266. }
  4267. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  4268. self
  4269. }
  4270. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  4271. Self::descriptor_static()
  4272. }
  4273. fn new() -> ClientResponsePlaintext {
  4274. ClientResponsePlaintext::new()
  4275. }
  4276. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  4277. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  4278. lock: ::protobuf::lazy::ONCE_INIT,
  4279. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  4280. };
  4281. unsafe {
  4282. descriptor.get(|| {
  4283. let mut fields = ::std::vec::Vec::new();
  4284. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<LoginCryptoResponseUnion>>(
  4285. "login_crypto_response",
  4286. |m: &ClientResponsePlaintext| { &m.login_crypto_response },
  4287. |m: &mut ClientResponsePlaintext| { &mut m.login_crypto_response },
  4288. ));
  4289. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<PoWResponseUnion>>(
  4290. "pow_response",
  4291. |m: &ClientResponsePlaintext| { &m.pow_response },
  4292. |m: &mut ClientResponsePlaintext| { &mut m.pow_response },
  4293. ));
  4294. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<CryptoResponseUnion>>(
  4295. "crypto_response",
  4296. |m: &ClientResponsePlaintext| { &m.crypto_response },
  4297. |m: &mut ClientResponsePlaintext| { &mut m.crypto_response },
  4298. ));
  4299. ::protobuf::reflect::MessageDescriptor::new::<ClientResponsePlaintext>(
  4300. "ClientResponsePlaintext",
  4301. fields,
  4302. file_descriptor_proto()
  4303. )
  4304. })
  4305. }
  4306. }
  4307. fn default_instance() -> &'static ClientResponsePlaintext {
  4308. static mut instance: ::protobuf::lazy::Lazy<ClientResponsePlaintext> = ::protobuf::lazy::Lazy {
  4309. lock: ::protobuf::lazy::ONCE_INIT,
  4310. ptr: 0 as *const ClientResponsePlaintext,
  4311. };
  4312. unsafe {
  4313. instance.get(ClientResponsePlaintext::new)
  4314. }
  4315. }
  4316. }
  4317. impl ::protobuf::Clear for ClientResponsePlaintext {
  4318. fn clear(&mut self) {
  4319. self.clear_login_crypto_response();
  4320. self.clear_pow_response();
  4321. self.clear_crypto_response();
  4322. self.unknown_fields.clear();
  4323. }
  4324. }
  4325. impl ::std::fmt::Debug for ClientResponsePlaintext {
  4326. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  4327. ::protobuf::text_format::fmt(self, f)
  4328. }
  4329. }
  4330. impl ::protobuf::reflect::ProtobufValue for ClientResponsePlaintext {
  4331. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  4332. ::protobuf::reflect::ProtobufValueRef::Message(self)
  4333. }
  4334. }
  4335. #[derive(PartialEq,Clone,Default)]
  4336. pub struct LoginCryptoResponseUnion {
  4337. // message fields
  4338. diffie_hellman: ::protobuf::SingularPtrField<LoginCryptoDiffieHellmanResponse>,
  4339. // special fields
  4340. unknown_fields: ::protobuf::UnknownFields,
  4341. cached_size: ::protobuf::CachedSize,
  4342. }
  4343. impl LoginCryptoResponseUnion {
  4344. pub fn new() -> LoginCryptoResponseUnion {
  4345. ::std::default::Default::default()
  4346. }
  4347. // optional .LoginCryptoDiffieHellmanResponse diffie_hellman = 10;
  4348. pub fn clear_diffie_hellman(&mut self) {
  4349. self.diffie_hellman.clear();
  4350. }
  4351. pub fn has_diffie_hellman(&self) -> bool {
  4352. self.diffie_hellman.is_some()
  4353. }
  4354. // Param is passed by value, moved
  4355. pub fn set_diffie_hellman(&mut self, v: LoginCryptoDiffieHellmanResponse) {
  4356. self.diffie_hellman = ::protobuf::SingularPtrField::some(v);
  4357. }
  4358. // Mutable pointer to the field.
  4359. // If field is not initialized, it is initialized with default value first.
  4360. pub fn mut_diffie_hellman(&mut self) -> &mut LoginCryptoDiffieHellmanResponse {
  4361. if self.diffie_hellman.is_none() {
  4362. self.diffie_hellman.set_default();
  4363. }
  4364. self.diffie_hellman.as_mut().unwrap()
  4365. }
  4366. // Take field
  4367. pub fn take_diffie_hellman(&mut self) -> LoginCryptoDiffieHellmanResponse {
  4368. self.diffie_hellman.take().unwrap_or_else(|| LoginCryptoDiffieHellmanResponse::new())
  4369. }
  4370. pub fn get_diffie_hellman(&self) -> &LoginCryptoDiffieHellmanResponse {
  4371. self.diffie_hellman.as_ref().unwrap_or_else(|| LoginCryptoDiffieHellmanResponse::default_instance())
  4372. }
  4373. }
  4374. impl ::protobuf::Message for LoginCryptoResponseUnion {
  4375. fn is_initialized(&self) -> bool {
  4376. for v in &self.diffie_hellman {
  4377. if !v.is_initialized() {
  4378. return false;
  4379. }
  4380. };
  4381. true
  4382. }
  4383. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  4384. while !is.eof()? {
  4385. let (field_number, wire_type) = is.read_tag_unpack()?;
  4386. match field_number {
  4387. 10 => {
  4388. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.diffie_hellman)?;
  4389. },
  4390. _ => {
  4391. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  4392. },
  4393. };
  4394. }
  4395. ::std::result::Result::Ok(())
  4396. }
  4397. // Compute sizes of nested messages
  4398. #[allow(unused_variables)]
  4399. fn compute_size(&self) -> u32 {
  4400. let mut my_size = 0;
  4401. if let Some(ref v) = self.diffie_hellman.as_ref() {
  4402. let len = v.compute_size();
  4403. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  4404. }
  4405. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  4406. self.cached_size.set(my_size);
  4407. my_size
  4408. }
  4409. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  4410. if let Some(ref v) = self.diffie_hellman.as_ref() {
  4411. os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  4412. os.write_raw_varint32(v.get_cached_size())?;
  4413. v.write_to_with_cached_sizes(os)?;
  4414. }
  4415. os.write_unknown_fields(self.get_unknown_fields())?;
  4416. ::std::result::Result::Ok(())
  4417. }
  4418. fn get_cached_size(&self) -> u32 {
  4419. self.cached_size.get()
  4420. }
  4421. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  4422. &self.unknown_fields
  4423. }
  4424. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  4425. &mut self.unknown_fields
  4426. }
  4427. fn as_any(&self) -> &::std::any::Any {
  4428. self as &::std::any::Any
  4429. }
  4430. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  4431. self as &mut ::std::any::Any
  4432. }
  4433. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  4434. self
  4435. }
  4436. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  4437. Self::descriptor_static()
  4438. }
  4439. fn new() -> LoginCryptoResponseUnion {
  4440. LoginCryptoResponseUnion::new()
  4441. }
  4442. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  4443. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  4444. lock: ::protobuf::lazy::ONCE_INIT,
  4445. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  4446. };
  4447. unsafe {
  4448. descriptor.get(|| {
  4449. let mut fields = ::std::vec::Vec::new();
  4450. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<LoginCryptoDiffieHellmanResponse>>(
  4451. "diffie_hellman",
  4452. |m: &LoginCryptoResponseUnion| { &m.diffie_hellman },
  4453. |m: &mut LoginCryptoResponseUnion| { &mut m.diffie_hellman },
  4454. ));
  4455. ::protobuf::reflect::MessageDescriptor::new::<LoginCryptoResponseUnion>(
  4456. "LoginCryptoResponseUnion",
  4457. fields,
  4458. file_descriptor_proto()
  4459. )
  4460. })
  4461. }
  4462. }
  4463. fn default_instance() -> &'static LoginCryptoResponseUnion {
  4464. static mut instance: ::protobuf::lazy::Lazy<LoginCryptoResponseUnion> = ::protobuf::lazy::Lazy {
  4465. lock: ::protobuf::lazy::ONCE_INIT,
  4466. ptr: 0 as *const LoginCryptoResponseUnion,
  4467. };
  4468. unsafe {
  4469. instance.get(LoginCryptoResponseUnion::new)
  4470. }
  4471. }
  4472. }
  4473. impl ::protobuf::Clear for LoginCryptoResponseUnion {
  4474. fn clear(&mut self) {
  4475. self.clear_diffie_hellman();
  4476. self.unknown_fields.clear();
  4477. }
  4478. }
  4479. impl ::std::fmt::Debug for LoginCryptoResponseUnion {
  4480. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  4481. ::protobuf::text_format::fmt(self, f)
  4482. }
  4483. }
  4484. impl ::protobuf::reflect::ProtobufValue for LoginCryptoResponseUnion {
  4485. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  4486. ::protobuf::reflect::ProtobufValueRef::Message(self)
  4487. }
  4488. }
  4489. #[derive(PartialEq,Clone,Default)]
  4490. pub struct LoginCryptoDiffieHellmanResponse {
  4491. // message fields
  4492. hmac: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  4493. // special fields
  4494. unknown_fields: ::protobuf::UnknownFields,
  4495. cached_size: ::protobuf::CachedSize,
  4496. }
  4497. impl LoginCryptoDiffieHellmanResponse {
  4498. pub fn new() -> LoginCryptoDiffieHellmanResponse {
  4499. ::std::default::Default::default()
  4500. }
  4501. // required bytes hmac = 10;
  4502. pub fn clear_hmac(&mut self) {
  4503. self.hmac.clear();
  4504. }
  4505. pub fn has_hmac(&self) -> bool {
  4506. self.hmac.is_some()
  4507. }
  4508. // Param is passed by value, moved
  4509. pub fn set_hmac(&mut self, v: ::std::vec::Vec<u8>) {
  4510. self.hmac = ::protobuf::SingularField::some(v);
  4511. }
  4512. // Mutable pointer to the field.
  4513. // If field is not initialized, it is initialized with default value first.
  4514. pub fn mut_hmac(&mut self) -> &mut ::std::vec::Vec<u8> {
  4515. if self.hmac.is_none() {
  4516. self.hmac.set_default();
  4517. }
  4518. self.hmac.as_mut().unwrap()
  4519. }
  4520. // Take field
  4521. pub fn take_hmac(&mut self) -> ::std::vec::Vec<u8> {
  4522. self.hmac.take().unwrap_or_else(|| ::std::vec::Vec::new())
  4523. }
  4524. pub fn get_hmac(&self) -> &[u8] {
  4525. match self.hmac.as_ref() {
  4526. Some(v) => &v,
  4527. None => &[],
  4528. }
  4529. }
  4530. }
  4531. impl ::protobuf::Message for LoginCryptoDiffieHellmanResponse {
  4532. fn is_initialized(&self) -> bool {
  4533. if self.hmac.is_none() {
  4534. return false;
  4535. }
  4536. true
  4537. }
  4538. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  4539. while !is.eof()? {
  4540. let (field_number, wire_type) = is.read_tag_unpack()?;
  4541. match field_number {
  4542. 10 => {
  4543. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.hmac)?;
  4544. },
  4545. _ => {
  4546. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  4547. },
  4548. };
  4549. }
  4550. ::std::result::Result::Ok(())
  4551. }
  4552. // Compute sizes of nested messages
  4553. #[allow(unused_variables)]
  4554. fn compute_size(&self) -> u32 {
  4555. let mut my_size = 0;
  4556. if let Some(ref v) = self.hmac.as_ref() {
  4557. my_size += ::protobuf::rt::bytes_size(10, &v);
  4558. }
  4559. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  4560. self.cached_size.set(my_size);
  4561. my_size
  4562. }
  4563. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  4564. if let Some(ref v) = self.hmac.as_ref() {
  4565. os.write_bytes(10, &v)?;
  4566. }
  4567. os.write_unknown_fields(self.get_unknown_fields())?;
  4568. ::std::result::Result::Ok(())
  4569. }
  4570. fn get_cached_size(&self) -> u32 {
  4571. self.cached_size.get()
  4572. }
  4573. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  4574. &self.unknown_fields
  4575. }
  4576. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  4577. &mut self.unknown_fields
  4578. }
  4579. fn as_any(&self) -> &::std::any::Any {
  4580. self as &::std::any::Any
  4581. }
  4582. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  4583. self as &mut ::std::any::Any
  4584. }
  4585. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  4586. self
  4587. }
  4588. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  4589. Self::descriptor_static()
  4590. }
  4591. fn new() -> LoginCryptoDiffieHellmanResponse {
  4592. LoginCryptoDiffieHellmanResponse::new()
  4593. }
  4594. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  4595. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  4596. lock: ::protobuf::lazy::ONCE_INIT,
  4597. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  4598. };
  4599. unsafe {
  4600. descriptor.get(|| {
  4601. let mut fields = ::std::vec::Vec::new();
  4602. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  4603. "hmac",
  4604. |m: &LoginCryptoDiffieHellmanResponse| { &m.hmac },
  4605. |m: &mut LoginCryptoDiffieHellmanResponse| { &mut m.hmac },
  4606. ));
  4607. ::protobuf::reflect::MessageDescriptor::new::<LoginCryptoDiffieHellmanResponse>(
  4608. "LoginCryptoDiffieHellmanResponse",
  4609. fields,
  4610. file_descriptor_proto()
  4611. )
  4612. })
  4613. }
  4614. }
  4615. fn default_instance() -> &'static LoginCryptoDiffieHellmanResponse {
  4616. static mut instance: ::protobuf::lazy::Lazy<LoginCryptoDiffieHellmanResponse> = ::protobuf::lazy::Lazy {
  4617. lock: ::protobuf::lazy::ONCE_INIT,
  4618. ptr: 0 as *const LoginCryptoDiffieHellmanResponse,
  4619. };
  4620. unsafe {
  4621. instance.get(LoginCryptoDiffieHellmanResponse::new)
  4622. }
  4623. }
  4624. }
  4625. impl ::protobuf::Clear for LoginCryptoDiffieHellmanResponse {
  4626. fn clear(&mut self) {
  4627. self.clear_hmac();
  4628. self.unknown_fields.clear();
  4629. }
  4630. }
  4631. impl ::std::fmt::Debug for LoginCryptoDiffieHellmanResponse {
  4632. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  4633. ::protobuf::text_format::fmt(self, f)
  4634. }
  4635. }
  4636. impl ::protobuf::reflect::ProtobufValue for LoginCryptoDiffieHellmanResponse {
  4637. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  4638. ::protobuf::reflect::ProtobufValueRef::Message(self)
  4639. }
  4640. }
  4641. #[derive(PartialEq,Clone,Default)]
  4642. pub struct PoWResponseUnion {
  4643. // message fields
  4644. hash_cash: ::protobuf::SingularPtrField<PoWHashCashResponse>,
  4645. // special fields
  4646. unknown_fields: ::protobuf::UnknownFields,
  4647. cached_size: ::protobuf::CachedSize,
  4648. }
  4649. impl PoWResponseUnion {
  4650. pub fn new() -> PoWResponseUnion {
  4651. ::std::default::Default::default()
  4652. }
  4653. // optional .PoWHashCashResponse hash_cash = 10;
  4654. pub fn clear_hash_cash(&mut self) {
  4655. self.hash_cash.clear();
  4656. }
  4657. pub fn has_hash_cash(&self) -> bool {
  4658. self.hash_cash.is_some()
  4659. }
  4660. // Param is passed by value, moved
  4661. pub fn set_hash_cash(&mut self, v: PoWHashCashResponse) {
  4662. self.hash_cash = ::protobuf::SingularPtrField::some(v);
  4663. }
  4664. // Mutable pointer to the field.
  4665. // If field is not initialized, it is initialized with default value first.
  4666. pub fn mut_hash_cash(&mut self) -> &mut PoWHashCashResponse {
  4667. if self.hash_cash.is_none() {
  4668. self.hash_cash.set_default();
  4669. }
  4670. self.hash_cash.as_mut().unwrap()
  4671. }
  4672. // Take field
  4673. pub fn take_hash_cash(&mut self) -> PoWHashCashResponse {
  4674. self.hash_cash.take().unwrap_or_else(|| PoWHashCashResponse::new())
  4675. }
  4676. pub fn get_hash_cash(&self) -> &PoWHashCashResponse {
  4677. self.hash_cash.as_ref().unwrap_or_else(|| PoWHashCashResponse::default_instance())
  4678. }
  4679. }
  4680. impl ::protobuf::Message for PoWResponseUnion {
  4681. fn is_initialized(&self) -> bool {
  4682. for v in &self.hash_cash {
  4683. if !v.is_initialized() {
  4684. return false;
  4685. }
  4686. };
  4687. true
  4688. }
  4689. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  4690. while !is.eof()? {
  4691. let (field_number, wire_type) = is.read_tag_unpack()?;
  4692. match field_number {
  4693. 10 => {
  4694. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.hash_cash)?;
  4695. },
  4696. _ => {
  4697. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  4698. },
  4699. };
  4700. }
  4701. ::std::result::Result::Ok(())
  4702. }
  4703. // Compute sizes of nested messages
  4704. #[allow(unused_variables)]
  4705. fn compute_size(&self) -> u32 {
  4706. let mut my_size = 0;
  4707. if let Some(ref v) = self.hash_cash.as_ref() {
  4708. let len = v.compute_size();
  4709. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  4710. }
  4711. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  4712. self.cached_size.set(my_size);
  4713. my_size
  4714. }
  4715. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  4716. if let Some(ref v) = self.hash_cash.as_ref() {
  4717. os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  4718. os.write_raw_varint32(v.get_cached_size())?;
  4719. v.write_to_with_cached_sizes(os)?;
  4720. }
  4721. os.write_unknown_fields(self.get_unknown_fields())?;
  4722. ::std::result::Result::Ok(())
  4723. }
  4724. fn get_cached_size(&self) -> u32 {
  4725. self.cached_size.get()
  4726. }
  4727. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  4728. &self.unknown_fields
  4729. }
  4730. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  4731. &mut self.unknown_fields
  4732. }
  4733. fn as_any(&self) -> &::std::any::Any {
  4734. self as &::std::any::Any
  4735. }
  4736. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  4737. self as &mut ::std::any::Any
  4738. }
  4739. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  4740. self
  4741. }
  4742. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  4743. Self::descriptor_static()
  4744. }
  4745. fn new() -> PoWResponseUnion {
  4746. PoWResponseUnion::new()
  4747. }
  4748. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  4749. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  4750. lock: ::protobuf::lazy::ONCE_INIT,
  4751. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  4752. };
  4753. unsafe {
  4754. descriptor.get(|| {
  4755. let mut fields = ::std::vec::Vec::new();
  4756. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<PoWHashCashResponse>>(
  4757. "hash_cash",
  4758. |m: &PoWResponseUnion| { &m.hash_cash },
  4759. |m: &mut PoWResponseUnion| { &mut m.hash_cash },
  4760. ));
  4761. ::protobuf::reflect::MessageDescriptor::new::<PoWResponseUnion>(
  4762. "PoWResponseUnion",
  4763. fields,
  4764. file_descriptor_proto()
  4765. )
  4766. })
  4767. }
  4768. }
  4769. fn default_instance() -> &'static PoWResponseUnion {
  4770. static mut instance: ::protobuf::lazy::Lazy<PoWResponseUnion> = ::protobuf::lazy::Lazy {
  4771. lock: ::protobuf::lazy::ONCE_INIT,
  4772. ptr: 0 as *const PoWResponseUnion,
  4773. };
  4774. unsafe {
  4775. instance.get(PoWResponseUnion::new)
  4776. }
  4777. }
  4778. }
  4779. impl ::protobuf::Clear for PoWResponseUnion {
  4780. fn clear(&mut self) {
  4781. self.clear_hash_cash();
  4782. self.unknown_fields.clear();
  4783. }
  4784. }
  4785. impl ::std::fmt::Debug for PoWResponseUnion {
  4786. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  4787. ::protobuf::text_format::fmt(self, f)
  4788. }
  4789. }
  4790. impl ::protobuf::reflect::ProtobufValue for PoWResponseUnion {
  4791. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  4792. ::protobuf::reflect::ProtobufValueRef::Message(self)
  4793. }
  4794. }
  4795. #[derive(PartialEq,Clone,Default)]
  4796. pub struct PoWHashCashResponse {
  4797. // message fields
  4798. hash_suffix: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  4799. // special fields
  4800. unknown_fields: ::protobuf::UnknownFields,
  4801. cached_size: ::protobuf::CachedSize,
  4802. }
  4803. impl PoWHashCashResponse {
  4804. pub fn new() -> PoWHashCashResponse {
  4805. ::std::default::Default::default()
  4806. }
  4807. // required bytes hash_suffix = 10;
  4808. pub fn clear_hash_suffix(&mut self) {
  4809. self.hash_suffix.clear();
  4810. }
  4811. pub fn has_hash_suffix(&self) -> bool {
  4812. self.hash_suffix.is_some()
  4813. }
  4814. // Param is passed by value, moved
  4815. pub fn set_hash_suffix(&mut self, v: ::std::vec::Vec<u8>) {
  4816. self.hash_suffix = ::protobuf::SingularField::some(v);
  4817. }
  4818. // Mutable pointer to the field.
  4819. // If field is not initialized, it is initialized with default value first.
  4820. pub fn mut_hash_suffix(&mut self) -> &mut ::std::vec::Vec<u8> {
  4821. if self.hash_suffix.is_none() {
  4822. self.hash_suffix.set_default();
  4823. }
  4824. self.hash_suffix.as_mut().unwrap()
  4825. }
  4826. // Take field
  4827. pub fn take_hash_suffix(&mut self) -> ::std::vec::Vec<u8> {
  4828. self.hash_suffix.take().unwrap_or_else(|| ::std::vec::Vec::new())
  4829. }
  4830. pub fn get_hash_suffix(&self) -> &[u8] {
  4831. match self.hash_suffix.as_ref() {
  4832. Some(v) => &v,
  4833. None => &[],
  4834. }
  4835. }
  4836. }
  4837. impl ::protobuf::Message for PoWHashCashResponse {
  4838. fn is_initialized(&self) -> bool {
  4839. if self.hash_suffix.is_none() {
  4840. return false;
  4841. }
  4842. true
  4843. }
  4844. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  4845. while !is.eof()? {
  4846. let (field_number, wire_type) = is.read_tag_unpack()?;
  4847. match field_number {
  4848. 10 => {
  4849. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.hash_suffix)?;
  4850. },
  4851. _ => {
  4852. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  4853. },
  4854. };
  4855. }
  4856. ::std::result::Result::Ok(())
  4857. }
  4858. // Compute sizes of nested messages
  4859. #[allow(unused_variables)]
  4860. fn compute_size(&self) -> u32 {
  4861. let mut my_size = 0;
  4862. if let Some(ref v) = self.hash_suffix.as_ref() {
  4863. my_size += ::protobuf::rt::bytes_size(10, &v);
  4864. }
  4865. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  4866. self.cached_size.set(my_size);
  4867. my_size
  4868. }
  4869. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  4870. if let Some(ref v) = self.hash_suffix.as_ref() {
  4871. os.write_bytes(10, &v)?;
  4872. }
  4873. os.write_unknown_fields(self.get_unknown_fields())?;
  4874. ::std::result::Result::Ok(())
  4875. }
  4876. fn get_cached_size(&self) -> u32 {
  4877. self.cached_size.get()
  4878. }
  4879. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  4880. &self.unknown_fields
  4881. }
  4882. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  4883. &mut self.unknown_fields
  4884. }
  4885. fn as_any(&self) -> &::std::any::Any {
  4886. self as &::std::any::Any
  4887. }
  4888. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  4889. self as &mut ::std::any::Any
  4890. }
  4891. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  4892. self
  4893. }
  4894. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  4895. Self::descriptor_static()
  4896. }
  4897. fn new() -> PoWHashCashResponse {
  4898. PoWHashCashResponse::new()
  4899. }
  4900. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  4901. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  4902. lock: ::protobuf::lazy::ONCE_INIT,
  4903. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  4904. };
  4905. unsafe {
  4906. descriptor.get(|| {
  4907. let mut fields = ::std::vec::Vec::new();
  4908. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  4909. "hash_suffix",
  4910. |m: &PoWHashCashResponse| { &m.hash_suffix },
  4911. |m: &mut PoWHashCashResponse| { &mut m.hash_suffix },
  4912. ));
  4913. ::protobuf::reflect::MessageDescriptor::new::<PoWHashCashResponse>(
  4914. "PoWHashCashResponse",
  4915. fields,
  4916. file_descriptor_proto()
  4917. )
  4918. })
  4919. }
  4920. }
  4921. fn default_instance() -> &'static PoWHashCashResponse {
  4922. static mut instance: ::protobuf::lazy::Lazy<PoWHashCashResponse> = ::protobuf::lazy::Lazy {
  4923. lock: ::protobuf::lazy::ONCE_INIT,
  4924. ptr: 0 as *const PoWHashCashResponse,
  4925. };
  4926. unsafe {
  4927. instance.get(PoWHashCashResponse::new)
  4928. }
  4929. }
  4930. }
  4931. impl ::protobuf::Clear for PoWHashCashResponse {
  4932. fn clear(&mut self) {
  4933. self.clear_hash_suffix();
  4934. self.unknown_fields.clear();
  4935. }
  4936. }
  4937. impl ::std::fmt::Debug for PoWHashCashResponse {
  4938. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  4939. ::protobuf::text_format::fmt(self, f)
  4940. }
  4941. }
  4942. impl ::protobuf::reflect::ProtobufValue for PoWHashCashResponse {
  4943. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  4944. ::protobuf::reflect::ProtobufValueRef::Message(self)
  4945. }
  4946. }
  4947. #[derive(PartialEq,Clone,Default)]
  4948. pub struct CryptoResponseUnion {
  4949. // message fields
  4950. shannon: ::protobuf::SingularPtrField<CryptoShannonResponse>,
  4951. rc4_sha1_hmac: ::protobuf::SingularPtrField<CryptoRc4Sha1HmacResponse>,
  4952. // special fields
  4953. unknown_fields: ::protobuf::UnknownFields,
  4954. cached_size: ::protobuf::CachedSize,
  4955. }
  4956. impl CryptoResponseUnion {
  4957. pub fn new() -> CryptoResponseUnion {
  4958. ::std::default::Default::default()
  4959. }
  4960. // optional .CryptoShannonResponse shannon = 10;
  4961. pub fn clear_shannon(&mut self) {
  4962. self.shannon.clear();
  4963. }
  4964. pub fn has_shannon(&self) -> bool {
  4965. self.shannon.is_some()
  4966. }
  4967. // Param is passed by value, moved
  4968. pub fn set_shannon(&mut self, v: CryptoShannonResponse) {
  4969. self.shannon = ::protobuf::SingularPtrField::some(v);
  4970. }
  4971. // Mutable pointer to the field.
  4972. // If field is not initialized, it is initialized with default value first.
  4973. pub fn mut_shannon(&mut self) -> &mut CryptoShannonResponse {
  4974. if self.shannon.is_none() {
  4975. self.shannon.set_default();
  4976. }
  4977. self.shannon.as_mut().unwrap()
  4978. }
  4979. // Take field
  4980. pub fn take_shannon(&mut self) -> CryptoShannonResponse {
  4981. self.shannon.take().unwrap_or_else(|| CryptoShannonResponse::new())
  4982. }
  4983. pub fn get_shannon(&self) -> &CryptoShannonResponse {
  4984. self.shannon.as_ref().unwrap_or_else(|| CryptoShannonResponse::default_instance())
  4985. }
  4986. // optional .CryptoRc4Sha1HmacResponse rc4_sha1_hmac = 20;
  4987. pub fn clear_rc4_sha1_hmac(&mut self) {
  4988. self.rc4_sha1_hmac.clear();
  4989. }
  4990. pub fn has_rc4_sha1_hmac(&self) -> bool {
  4991. self.rc4_sha1_hmac.is_some()
  4992. }
  4993. // Param is passed by value, moved
  4994. pub fn set_rc4_sha1_hmac(&mut self, v: CryptoRc4Sha1HmacResponse) {
  4995. self.rc4_sha1_hmac = ::protobuf::SingularPtrField::some(v);
  4996. }
  4997. // Mutable pointer to the field.
  4998. // If field is not initialized, it is initialized with default value first.
  4999. pub fn mut_rc4_sha1_hmac(&mut self) -> &mut CryptoRc4Sha1HmacResponse {
  5000. if self.rc4_sha1_hmac.is_none() {
  5001. self.rc4_sha1_hmac.set_default();
  5002. }
  5003. self.rc4_sha1_hmac.as_mut().unwrap()
  5004. }
  5005. // Take field
  5006. pub fn take_rc4_sha1_hmac(&mut self) -> CryptoRc4Sha1HmacResponse {
  5007. self.rc4_sha1_hmac.take().unwrap_or_else(|| CryptoRc4Sha1HmacResponse::new())
  5008. }
  5009. pub fn get_rc4_sha1_hmac(&self) -> &CryptoRc4Sha1HmacResponse {
  5010. self.rc4_sha1_hmac.as_ref().unwrap_or_else(|| CryptoRc4Sha1HmacResponse::default_instance())
  5011. }
  5012. }
  5013. impl ::protobuf::Message for CryptoResponseUnion {
  5014. fn is_initialized(&self) -> bool {
  5015. for v in &self.shannon {
  5016. if !v.is_initialized() {
  5017. return false;
  5018. }
  5019. };
  5020. for v in &self.rc4_sha1_hmac {
  5021. if !v.is_initialized() {
  5022. return false;
  5023. }
  5024. };
  5025. true
  5026. }
  5027. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  5028. while !is.eof()? {
  5029. let (field_number, wire_type) = is.read_tag_unpack()?;
  5030. match field_number {
  5031. 10 => {
  5032. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.shannon)?;
  5033. },
  5034. 20 => {
  5035. ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.rc4_sha1_hmac)?;
  5036. },
  5037. _ => {
  5038. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  5039. },
  5040. };
  5041. }
  5042. ::std::result::Result::Ok(())
  5043. }
  5044. // Compute sizes of nested messages
  5045. #[allow(unused_variables)]
  5046. fn compute_size(&self) -> u32 {
  5047. let mut my_size = 0;
  5048. if let Some(ref v) = self.shannon.as_ref() {
  5049. let len = v.compute_size();
  5050. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  5051. }
  5052. if let Some(ref v) = self.rc4_sha1_hmac.as_ref() {
  5053. let len = v.compute_size();
  5054. my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  5055. }
  5056. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  5057. self.cached_size.set(my_size);
  5058. my_size
  5059. }
  5060. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  5061. if let Some(ref v) = self.shannon.as_ref() {
  5062. os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  5063. os.write_raw_varint32(v.get_cached_size())?;
  5064. v.write_to_with_cached_sizes(os)?;
  5065. }
  5066. if let Some(ref v) = self.rc4_sha1_hmac.as_ref() {
  5067. os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  5068. os.write_raw_varint32(v.get_cached_size())?;
  5069. v.write_to_with_cached_sizes(os)?;
  5070. }
  5071. os.write_unknown_fields(self.get_unknown_fields())?;
  5072. ::std::result::Result::Ok(())
  5073. }
  5074. fn get_cached_size(&self) -> u32 {
  5075. self.cached_size.get()
  5076. }
  5077. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  5078. &self.unknown_fields
  5079. }
  5080. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  5081. &mut self.unknown_fields
  5082. }
  5083. fn as_any(&self) -> &::std::any::Any {
  5084. self as &::std::any::Any
  5085. }
  5086. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  5087. self as &mut ::std::any::Any
  5088. }
  5089. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  5090. self
  5091. }
  5092. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  5093. Self::descriptor_static()
  5094. }
  5095. fn new() -> CryptoResponseUnion {
  5096. CryptoResponseUnion::new()
  5097. }
  5098. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  5099. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  5100. lock: ::protobuf::lazy::ONCE_INIT,
  5101. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  5102. };
  5103. unsafe {
  5104. descriptor.get(|| {
  5105. let mut fields = ::std::vec::Vec::new();
  5106. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<CryptoShannonResponse>>(
  5107. "shannon",
  5108. |m: &CryptoResponseUnion| { &m.shannon },
  5109. |m: &mut CryptoResponseUnion| { &mut m.shannon },
  5110. ));
  5111. fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<CryptoRc4Sha1HmacResponse>>(
  5112. "rc4_sha1_hmac",
  5113. |m: &CryptoResponseUnion| { &m.rc4_sha1_hmac },
  5114. |m: &mut CryptoResponseUnion| { &mut m.rc4_sha1_hmac },
  5115. ));
  5116. ::protobuf::reflect::MessageDescriptor::new::<CryptoResponseUnion>(
  5117. "CryptoResponseUnion",
  5118. fields,
  5119. file_descriptor_proto()
  5120. )
  5121. })
  5122. }
  5123. }
  5124. fn default_instance() -> &'static CryptoResponseUnion {
  5125. static mut instance: ::protobuf::lazy::Lazy<CryptoResponseUnion> = ::protobuf::lazy::Lazy {
  5126. lock: ::protobuf::lazy::ONCE_INIT,
  5127. ptr: 0 as *const CryptoResponseUnion,
  5128. };
  5129. unsafe {
  5130. instance.get(CryptoResponseUnion::new)
  5131. }
  5132. }
  5133. }
  5134. impl ::protobuf::Clear for CryptoResponseUnion {
  5135. fn clear(&mut self) {
  5136. self.clear_shannon();
  5137. self.clear_rc4_sha1_hmac();
  5138. self.unknown_fields.clear();
  5139. }
  5140. }
  5141. impl ::std::fmt::Debug for CryptoResponseUnion {
  5142. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  5143. ::protobuf::text_format::fmt(self, f)
  5144. }
  5145. }
  5146. impl ::protobuf::reflect::ProtobufValue for CryptoResponseUnion {
  5147. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  5148. ::protobuf::reflect::ProtobufValueRef::Message(self)
  5149. }
  5150. }
  5151. #[derive(PartialEq,Clone,Default)]
  5152. pub struct CryptoShannonResponse {
  5153. // message fields
  5154. dummy: ::std::option::Option<i32>,
  5155. // special fields
  5156. unknown_fields: ::protobuf::UnknownFields,
  5157. cached_size: ::protobuf::CachedSize,
  5158. }
  5159. impl CryptoShannonResponse {
  5160. pub fn new() -> CryptoShannonResponse {
  5161. ::std::default::Default::default()
  5162. }
  5163. // optional int32 dummy = 1;
  5164. pub fn clear_dummy(&mut self) {
  5165. self.dummy = ::std::option::Option::None;
  5166. }
  5167. pub fn has_dummy(&self) -> bool {
  5168. self.dummy.is_some()
  5169. }
  5170. // Param is passed by value, moved
  5171. pub fn set_dummy(&mut self, v: i32) {
  5172. self.dummy = ::std::option::Option::Some(v);
  5173. }
  5174. pub fn get_dummy(&self) -> i32 {
  5175. self.dummy.unwrap_or(0)
  5176. }
  5177. }
  5178. impl ::protobuf::Message for CryptoShannonResponse {
  5179. fn is_initialized(&self) -> bool {
  5180. true
  5181. }
  5182. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  5183. while !is.eof()? {
  5184. let (field_number, wire_type) = is.read_tag_unpack()?;
  5185. match field_number {
  5186. 1 => {
  5187. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  5188. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  5189. }
  5190. let tmp = is.read_int32()?;
  5191. self.dummy = ::std::option::Option::Some(tmp);
  5192. },
  5193. _ => {
  5194. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  5195. },
  5196. };
  5197. }
  5198. ::std::result::Result::Ok(())
  5199. }
  5200. // Compute sizes of nested messages
  5201. #[allow(unused_variables)]
  5202. fn compute_size(&self) -> u32 {
  5203. let mut my_size = 0;
  5204. if let Some(v) = self.dummy {
  5205. my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
  5206. }
  5207. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  5208. self.cached_size.set(my_size);
  5209. my_size
  5210. }
  5211. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  5212. if let Some(v) = self.dummy {
  5213. os.write_int32(1, v)?;
  5214. }
  5215. os.write_unknown_fields(self.get_unknown_fields())?;
  5216. ::std::result::Result::Ok(())
  5217. }
  5218. fn get_cached_size(&self) -> u32 {
  5219. self.cached_size.get()
  5220. }
  5221. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  5222. &self.unknown_fields
  5223. }
  5224. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  5225. &mut self.unknown_fields
  5226. }
  5227. fn as_any(&self) -> &::std::any::Any {
  5228. self as &::std::any::Any
  5229. }
  5230. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  5231. self as &mut ::std::any::Any
  5232. }
  5233. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  5234. self
  5235. }
  5236. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  5237. Self::descriptor_static()
  5238. }
  5239. fn new() -> CryptoShannonResponse {
  5240. CryptoShannonResponse::new()
  5241. }
  5242. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  5243. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  5244. lock: ::protobuf::lazy::ONCE_INIT,
  5245. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  5246. };
  5247. unsafe {
  5248. descriptor.get(|| {
  5249. let mut fields = ::std::vec::Vec::new();
  5250. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  5251. "dummy",
  5252. |m: &CryptoShannonResponse| { &m.dummy },
  5253. |m: &mut CryptoShannonResponse| { &mut m.dummy },
  5254. ));
  5255. ::protobuf::reflect::MessageDescriptor::new::<CryptoShannonResponse>(
  5256. "CryptoShannonResponse",
  5257. fields,
  5258. file_descriptor_proto()
  5259. )
  5260. })
  5261. }
  5262. }
  5263. fn default_instance() -> &'static CryptoShannonResponse {
  5264. static mut instance: ::protobuf::lazy::Lazy<CryptoShannonResponse> = ::protobuf::lazy::Lazy {
  5265. lock: ::protobuf::lazy::ONCE_INIT,
  5266. ptr: 0 as *const CryptoShannonResponse,
  5267. };
  5268. unsafe {
  5269. instance.get(CryptoShannonResponse::new)
  5270. }
  5271. }
  5272. }
  5273. impl ::protobuf::Clear for CryptoShannonResponse {
  5274. fn clear(&mut self) {
  5275. self.clear_dummy();
  5276. self.unknown_fields.clear();
  5277. }
  5278. }
  5279. impl ::std::fmt::Debug for CryptoShannonResponse {
  5280. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  5281. ::protobuf::text_format::fmt(self, f)
  5282. }
  5283. }
  5284. impl ::protobuf::reflect::ProtobufValue for CryptoShannonResponse {
  5285. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  5286. ::protobuf::reflect::ProtobufValueRef::Message(self)
  5287. }
  5288. }
  5289. #[derive(PartialEq,Clone,Default)]
  5290. pub struct CryptoRc4Sha1HmacResponse {
  5291. // message fields
  5292. dummy: ::std::option::Option<i32>,
  5293. // special fields
  5294. unknown_fields: ::protobuf::UnknownFields,
  5295. cached_size: ::protobuf::CachedSize,
  5296. }
  5297. impl CryptoRc4Sha1HmacResponse {
  5298. pub fn new() -> CryptoRc4Sha1HmacResponse {
  5299. ::std::default::Default::default()
  5300. }
  5301. // optional int32 dummy = 1;
  5302. pub fn clear_dummy(&mut self) {
  5303. self.dummy = ::std::option::Option::None;
  5304. }
  5305. pub fn has_dummy(&self) -> bool {
  5306. self.dummy.is_some()
  5307. }
  5308. // Param is passed by value, moved
  5309. pub fn set_dummy(&mut self, v: i32) {
  5310. self.dummy = ::std::option::Option::Some(v);
  5311. }
  5312. pub fn get_dummy(&self) -> i32 {
  5313. self.dummy.unwrap_or(0)
  5314. }
  5315. }
  5316. impl ::protobuf::Message for CryptoRc4Sha1HmacResponse {
  5317. fn is_initialized(&self) -> bool {
  5318. true
  5319. }
  5320. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  5321. while !is.eof()? {
  5322. let (field_number, wire_type) = is.read_tag_unpack()?;
  5323. match field_number {
  5324. 1 => {
  5325. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  5326. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  5327. }
  5328. let tmp = is.read_int32()?;
  5329. self.dummy = ::std::option::Option::Some(tmp);
  5330. },
  5331. _ => {
  5332. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  5333. },
  5334. };
  5335. }
  5336. ::std::result::Result::Ok(())
  5337. }
  5338. // Compute sizes of nested messages
  5339. #[allow(unused_variables)]
  5340. fn compute_size(&self) -> u32 {
  5341. let mut my_size = 0;
  5342. if let Some(v) = self.dummy {
  5343. my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
  5344. }
  5345. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  5346. self.cached_size.set(my_size);
  5347. my_size
  5348. }
  5349. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  5350. if let Some(v) = self.dummy {
  5351. os.write_int32(1, v)?;
  5352. }
  5353. os.write_unknown_fields(self.get_unknown_fields())?;
  5354. ::std::result::Result::Ok(())
  5355. }
  5356. fn get_cached_size(&self) -> u32 {
  5357. self.cached_size.get()
  5358. }
  5359. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  5360. &self.unknown_fields
  5361. }
  5362. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  5363. &mut self.unknown_fields
  5364. }
  5365. fn as_any(&self) -> &::std::any::Any {
  5366. self as &::std::any::Any
  5367. }
  5368. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  5369. self as &mut ::std::any::Any
  5370. }
  5371. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  5372. self
  5373. }
  5374. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  5375. Self::descriptor_static()
  5376. }
  5377. fn new() -> CryptoRc4Sha1HmacResponse {
  5378. CryptoRc4Sha1HmacResponse::new()
  5379. }
  5380. fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
  5381. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  5382. lock: ::protobuf::lazy::ONCE_INIT,
  5383. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  5384. };
  5385. unsafe {
  5386. descriptor.get(|| {
  5387. let mut fields = ::std::vec::Vec::new();
  5388. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
  5389. "dummy",
  5390. |m: &CryptoRc4Sha1HmacResponse| { &m.dummy },
  5391. |m: &mut CryptoRc4Sha1HmacResponse| { &mut m.dummy },
  5392. ));
  5393. ::protobuf::reflect::MessageDescriptor::new::<CryptoRc4Sha1HmacResponse>(
  5394. "CryptoRc4Sha1HmacResponse",
  5395. fields,
  5396. file_descriptor_proto()
  5397. )
  5398. })
  5399. }
  5400. }
  5401. fn default_instance() -> &'static CryptoRc4Sha1HmacResponse {
  5402. static mut instance: ::protobuf::lazy::Lazy<CryptoRc4Sha1HmacResponse> = ::protobuf::lazy::Lazy {
  5403. lock: ::protobuf::lazy::ONCE_INIT,
  5404. ptr: 0 as *const CryptoRc4Sha1HmacResponse,
  5405. };
  5406. unsafe {
  5407. instance.get(CryptoRc4Sha1HmacResponse::new)
  5408. }
  5409. }
  5410. }
  5411. impl ::protobuf::Clear for CryptoRc4Sha1HmacResponse {
  5412. fn clear(&mut self) {
  5413. self.clear_dummy();
  5414. self.unknown_fields.clear();
  5415. }
  5416. }
  5417. impl ::std::fmt::Debug for CryptoRc4Sha1HmacResponse {
  5418. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  5419. ::protobuf::text_format::fmt(self, f)
  5420. }
  5421. }
  5422. impl ::protobuf::reflect::ProtobufValue for CryptoRc4Sha1HmacResponse {
  5423. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  5424. ::protobuf::reflect::ProtobufValueRef::Message(self)
  5425. }
  5426. }
  5427. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  5428. pub enum Product {
  5429. PRODUCT_CLIENT = 0,
  5430. PRODUCT_LIBSPOTIFY = 1,
  5431. PRODUCT_MOBILE = 2,
  5432. PRODUCT_PARTNER = 3,
  5433. PRODUCT_LIBSPOTIFY_EMBEDDED = 5,
  5434. }
  5435. impl ::protobuf::ProtobufEnum for Product {
  5436. fn value(&self) -> i32 {
  5437. *self as i32
  5438. }
  5439. fn from_i32(value: i32) -> ::std::option::Option<Product> {
  5440. match value {
  5441. 0 => ::std::option::Option::Some(Product::PRODUCT_CLIENT),
  5442. 1 => ::std::option::Option::Some(Product::PRODUCT_LIBSPOTIFY),
  5443. 2 => ::std::option::Option::Some(Product::PRODUCT_MOBILE),
  5444. 3 => ::std::option::Option::Some(Product::PRODUCT_PARTNER),
  5445. 5 => ::std::option::Option::Some(Product::PRODUCT_LIBSPOTIFY_EMBEDDED),
  5446. _ => ::std::option::Option::None
  5447. }
  5448. }
  5449. fn values() -> &'static [Self] {
  5450. static values: &'static [Product] = &[
  5451. Product::PRODUCT_CLIENT,
  5452. Product::PRODUCT_LIBSPOTIFY,
  5453. Product::PRODUCT_MOBILE,
  5454. Product::PRODUCT_PARTNER,
  5455. Product::PRODUCT_LIBSPOTIFY_EMBEDDED,
  5456. ];
  5457. values
  5458. }
  5459. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  5460. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
  5461. lock: ::protobuf::lazy::ONCE_INIT,
  5462. ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
  5463. };
  5464. unsafe {
  5465. descriptor.get(|| {
  5466. ::protobuf::reflect::EnumDescriptor::new("Product", file_descriptor_proto())
  5467. })
  5468. }
  5469. }
  5470. }
  5471. impl ::std::marker::Copy for Product {
  5472. }
  5473. impl ::protobuf::reflect::ProtobufValue for Product {
  5474. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  5475. ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
  5476. }
  5477. }
  5478. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  5479. pub enum ProductFlags {
  5480. PRODUCT_FLAG_NONE = 0,
  5481. PRODUCT_FLAG_DEV_BUILD = 1,
  5482. }
  5483. impl ::protobuf::ProtobufEnum for ProductFlags {
  5484. fn value(&self) -> i32 {
  5485. *self as i32
  5486. }
  5487. fn from_i32(value: i32) -> ::std::option::Option<ProductFlags> {
  5488. match value {
  5489. 0 => ::std::option::Option::Some(ProductFlags::PRODUCT_FLAG_NONE),
  5490. 1 => ::std::option::Option::Some(ProductFlags::PRODUCT_FLAG_DEV_BUILD),
  5491. _ => ::std::option::Option::None
  5492. }
  5493. }
  5494. fn values() -> &'static [Self] {
  5495. static values: &'static [ProductFlags] = &[
  5496. ProductFlags::PRODUCT_FLAG_NONE,
  5497. ProductFlags::PRODUCT_FLAG_DEV_BUILD,
  5498. ];
  5499. values
  5500. }
  5501. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  5502. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
  5503. lock: ::protobuf::lazy::ONCE_INIT,
  5504. ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
  5505. };
  5506. unsafe {
  5507. descriptor.get(|| {
  5508. ::protobuf::reflect::EnumDescriptor::new("ProductFlags", file_descriptor_proto())
  5509. })
  5510. }
  5511. }
  5512. }
  5513. impl ::std::marker::Copy for ProductFlags {
  5514. }
  5515. impl ::protobuf::reflect::ProtobufValue for ProductFlags {
  5516. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  5517. ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
  5518. }
  5519. }
  5520. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  5521. pub enum Platform {
  5522. PLATFORM_WIN32_X86 = 0,
  5523. PLATFORM_OSX_X86 = 1,
  5524. PLATFORM_LINUX_X86 = 2,
  5525. PLATFORM_IPHONE_ARM = 3,
  5526. PLATFORM_S60_ARM = 4,
  5527. PLATFORM_OSX_PPC = 5,
  5528. PLATFORM_ANDROID_ARM = 6,
  5529. PLATFORM_WINDOWS_CE_ARM = 7,
  5530. PLATFORM_LINUX_X86_64 = 8,
  5531. PLATFORM_OSX_X86_64 = 9,
  5532. PLATFORM_PALM_ARM = 10,
  5533. PLATFORM_LINUX_SH = 11,
  5534. PLATFORM_FREEBSD_X86 = 12,
  5535. PLATFORM_FREEBSD_X86_64 = 13,
  5536. PLATFORM_BLACKBERRY_ARM = 14,
  5537. PLATFORM_SONOS = 15,
  5538. PLATFORM_LINUX_MIPS = 16,
  5539. PLATFORM_LINUX_ARM = 17,
  5540. PLATFORM_LOGITECH_ARM = 18,
  5541. PLATFORM_LINUX_BLACKFIN = 19,
  5542. PLATFORM_WP7_ARM = 20,
  5543. PLATFORM_ONKYO_ARM = 21,
  5544. PLATFORM_QNXNTO_ARM = 22,
  5545. PLATFORM_BCO_ARM = 23,
  5546. }
  5547. impl ::protobuf::ProtobufEnum for Platform {
  5548. fn value(&self) -> i32 {
  5549. *self as i32
  5550. }
  5551. fn from_i32(value: i32) -> ::std::option::Option<Platform> {
  5552. match value {
  5553. 0 => ::std::option::Option::Some(Platform::PLATFORM_WIN32_X86),
  5554. 1 => ::std::option::Option::Some(Platform::PLATFORM_OSX_X86),
  5555. 2 => ::std::option::Option::Some(Platform::PLATFORM_LINUX_X86),
  5556. 3 => ::std::option::Option::Some(Platform::PLATFORM_IPHONE_ARM),
  5557. 4 => ::std::option::Option::Some(Platform::PLATFORM_S60_ARM),
  5558. 5 => ::std::option::Option::Some(Platform::PLATFORM_OSX_PPC),
  5559. 6 => ::std::option::Option::Some(Platform::PLATFORM_ANDROID_ARM),
  5560. 7 => ::std::option::Option::Some(Platform::PLATFORM_WINDOWS_CE_ARM),
  5561. 8 => ::std::option::Option::Some(Platform::PLATFORM_LINUX_X86_64),
  5562. 9 => ::std::option::Option::Some(Platform::PLATFORM_OSX_X86_64),
  5563. 10 => ::std::option::Option::Some(Platform::PLATFORM_PALM_ARM),
  5564. 11 => ::std::option::Option::Some(Platform::PLATFORM_LINUX_SH),
  5565. 12 => ::std::option::Option::Some(Platform::PLATFORM_FREEBSD_X86),
  5566. 13 => ::std::option::Option::Some(Platform::PLATFORM_FREEBSD_X86_64),
  5567. 14 => ::std::option::Option::Some(Platform::PLATFORM_BLACKBERRY_ARM),
  5568. 15 => ::std::option::Option::Some(Platform::PLATFORM_SONOS),
  5569. 16 => ::std::option::Option::Some(Platform::PLATFORM_LINUX_MIPS),
  5570. 17 => ::std::option::Option::Some(Platform::PLATFORM_LINUX_ARM),
  5571. 18 => ::std::option::Option::Some(Platform::PLATFORM_LOGITECH_ARM),
  5572. 19 => ::std::option::Option::Some(Platform::PLATFORM_LINUX_BLACKFIN),
  5573. 20 => ::std::option::Option::Some(Platform::PLATFORM_WP7_ARM),
  5574. 21 => ::std::option::Option::Some(Platform::PLATFORM_ONKYO_ARM),
  5575. 22 => ::std::option::Option::Some(Platform::PLATFORM_QNXNTO_ARM),
  5576. 23 => ::std::option::Option::Some(Platform::PLATFORM_BCO_ARM),
  5577. _ => ::std::option::Option::None
  5578. }
  5579. }
  5580. fn values() -> &'static [Self] {
  5581. static values: &'static [Platform] = &[
  5582. Platform::PLATFORM_WIN32_X86,
  5583. Platform::PLATFORM_OSX_X86,
  5584. Platform::PLATFORM_LINUX_X86,
  5585. Platform::PLATFORM_IPHONE_ARM,
  5586. Platform::PLATFORM_S60_ARM,
  5587. Platform::PLATFORM_OSX_PPC,
  5588. Platform::PLATFORM_ANDROID_ARM,
  5589. Platform::PLATFORM_WINDOWS_CE_ARM,
  5590. Platform::PLATFORM_LINUX_X86_64,
  5591. Platform::PLATFORM_OSX_X86_64,
  5592. Platform::PLATFORM_PALM_ARM,
  5593. Platform::PLATFORM_LINUX_SH,
  5594. Platform::PLATFORM_FREEBSD_X86,
  5595. Platform::PLATFORM_FREEBSD_X86_64,
  5596. Platform::PLATFORM_BLACKBERRY_ARM,
  5597. Platform::PLATFORM_SONOS,
  5598. Platform::PLATFORM_LINUX_MIPS,
  5599. Platform::PLATFORM_LINUX_ARM,
  5600. Platform::PLATFORM_LOGITECH_ARM,
  5601. Platform::PLATFORM_LINUX_BLACKFIN,
  5602. Platform::PLATFORM_WP7_ARM,
  5603. Platform::PLATFORM_ONKYO_ARM,
  5604. Platform::PLATFORM_QNXNTO_ARM,
  5605. Platform::PLATFORM_BCO_ARM,
  5606. ];
  5607. values
  5608. }
  5609. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  5610. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
  5611. lock: ::protobuf::lazy::ONCE_INIT,
  5612. ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
  5613. };
  5614. unsafe {
  5615. descriptor.get(|| {
  5616. ::protobuf::reflect::EnumDescriptor::new("Platform", file_descriptor_proto())
  5617. })
  5618. }
  5619. }
  5620. }
  5621. impl ::std::marker::Copy for Platform {
  5622. }
  5623. impl ::protobuf::reflect::ProtobufValue for Platform {
  5624. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  5625. ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
  5626. }
  5627. }
  5628. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  5629. pub enum Fingerprint {
  5630. FINGERPRINT_GRAIN = 0,
  5631. FINGERPRINT_HMAC_RIPEMD = 1,
  5632. }
  5633. impl ::protobuf::ProtobufEnum for Fingerprint {
  5634. fn value(&self) -> i32 {
  5635. *self as i32
  5636. }
  5637. fn from_i32(value: i32) -> ::std::option::Option<Fingerprint> {
  5638. match value {
  5639. 0 => ::std::option::Option::Some(Fingerprint::FINGERPRINT_GRAIN),
  5640. 1 => ::std::option::Option::Some(Fingerprint::FINGERPRINT_HMAC_RIPEMD),
  5641. _ => ::std::option::Option::None
  5642. }
  5643. }
  5644. fn values() -> &'static [Self] {
  5645. static values: &'static [Fingerprint] = &[
  5646. Fingerprint::FINGERPRINT_GRAIN,
  5647. Fingerprint::FINGERPRINT_HMAC_RIPEMD,
  5648. ];
  5649. values
  5650. }
  5651. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  5652. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
  5653. lock: ::protobuf::lazy::ONCE_INIT,
  5654. ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
  5655. };
  5656. unsafe {
  5657. descriptor.get(|| {
  5658. ::protobuf::reflect::EnumDescriptor::new("Fingerprint", file_descriptor_proto())
  5659. })
  5660. }
  5661. }
  5662. }
  5663. impl ::std::marker::Copy for Fingerprint {
  5664. }
  5665. impl ::protobuf::reflect::ProtobufValue for Fingerprint {
  5666. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  5667. ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
  5668. }
  5669. }
  5670. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  5671. pub enum Cryptosuite {
  5672. CRYPTO_SUITE_SHANNON = 0,
  5673. CRYPTO_SUITE_RC4_SHA1_HMAC = 1,
  5674. }
  5675. impl ::protobuf::ProtobufEnum for Cryptosuite {
  5676. fn value(&self) -> i32 {
  5677. *self as i32
  5678. }
  5679. fn from_i32(value: i32) -> ::std::option::Option<Cryptosuite> {
  5680. match value {
  5681. 0 => ::std::option::Option::Some(Cryptosuite::CRYPTO_SUITE_SHANNON),
  5682. 1 => ::std::option::Option::Some(Cryptosuite::CRYPTO_SUITE_RC4_SHA1_HMAC),
  5683. _ => ::std::option::Option::None
  5684. }
  5685. }
  5686. fn values() -> &'static [Self] {
  5687. static values: &'static [Cryptosuite] = &[
  5688. Cryptosuite::CRYPTO_SUITE_SHANNON,
  5689. Cryptosuite::CRYPTO_SUITE_RC4_SHA1_HMAC,
  5690. ];
  5691. values
  5692. }
  5693. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  5694. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
  5695. lock: ::protobuf::lazy::ONCE_INIT,
  5696. ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
  5697. };
  5698. unsafe {
  5699. descriptor.get(|| {
  5700. ::protobuf::reflect::EnumDescriptor::new("Cryptosuite", file_descriptor_proto())
  5701. })
  5702. }
  5703. }
  5704. }
  5705. impl ::std::marker::Copy for Cryptosuite {
  5706. }
  5707. impl ::protobuf::reflect::ProtobufValue for Cryptosuite {
  5708. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  5709. ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
  5710. }
  5711. }
  5712. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  5713. pub enum Powscheme {
  5714. POW_HASH_CASH = 0,
  5715. }
  5716. impl ::protobuf::ProtobufEnum for Powscheme {
  5717. fn value(&self) -> i32 {
  5718. *self as i32
  5719. }
  5720. fn from_i32(value: i32) -> ::std::option::Option<Powscheme> {
  5721. match value {
  5722. 0 => ::std::option::Option::Some(Powscheme::POW_HASH_CASH),
  5723. _ => ::std::option::Option::None
  5724. }
  5725. }
  5726. fn values() -> &'static [Self] {
  5727. static values: &'static [Powscheme] = &[
  5728. Powscheme::POW_HASH_CASH,
  5729. ];
  5730. values
  5731. }
  5732. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  5733. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
  5734. lock: ::protobuf::lazy::ONCE_INIT,
  5735. ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
  5736. };
  5737. unsafe {
  5738. descriptor.get(|| {
  5739. ::protobuf::reflect::EnumDescriptor::new("Powscheme", file_descriptor_proto())
  5740. })
  5741. }
  5742. }
  5743. }
  5744. impl ::std::marker::Copy for Powscheme {
  5745. }
  5746. impl ::protobuf::reflect::ProtobufValue for Powscheme {
  5747. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  5748. ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
  5749. }
  5750. }
  5751. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  5752. pub enum ErrorCode {
  5753. ProtocolError = 0,
  5754. TryAnotherAP = 2,
  5755. BadConnectionId = 5,
  5756. TravelRestriction = 9,
  5757. PremiumAccountRequired = 11,
  5758. BadCredentials = 12,
  5759. CouldNotValidateCredentials = 13,
  5760. AccountExists = 14,
  5761. ExtraVerificationRequired = 15,
  5762. InvalidAppKey = 16,
  5763. ApplicationBanned = 17,
  5764. }
  5765. impl ::protobuf::ProtobufEnum for ErrorCode {
  5766. fn value(&self) -> i32 {
  5767. *self as i32
  5768. }
  5769. fn from_i32(value: i32) -> ::std::option::Option<ErrorCode> {
  5770. match value {
  5771. 0 => ::std::option::Option::Some(ErrorCode::ProtocolError),
  5772. 2 => ::std::option::Option::Some(ErrorCode::TryAnotherAP),
  5773. 5 => ::std::option::Option::Some(ErrorCode::BadConnectionId),
  5774. 9 => ::std::option::Option::Some(ErrorCode::TravelRestriction),
  5775. 11 => ::std::option::Option::Some(ErrorCode::PremiumAccountRequired),
  5776. 12 => ::std::option::Option::Some(ErrorCode::BadCredentials),
  5777. 13 => ::std::option::Option::Some(ErrorCode::CouldNotValidateCredentials),
  5778. 14 => ::std::option::Option::Some(ErrorCode::AccountExists),
  5779. 15 => ::std::option::Option::Some(ErrorCode::ExtraVerificationRequired),
  5780. 16 => ::std::option::Option::Some(ErrorCode::InvalidAppKey),
  5781. 17 => ::std::option::Option::Some(ErrorCode::ApplicationBanned),
  5782. _ => ::std::option::Option::None
  5783. }
  5784. }
  5785. fn values() -> &'static [Self] {
  5786. static values: &'static [ErrorCode] = &[
  5787. ErrorCode::ProtocolError,
  5788. ErrorCode::TryAnotherAP,
  5789. ErrorCode::BadConnectionId,
  5790. ErrorCode::TravelRestriction,
  5791. ErrorCode::PremiumAccountRequired,
  5792. ErrorCode::BadCredentials,
  5793. ErrorCode::CouldNotValidateCredentials,
  5794. ErrorCode::AccountExists,
  5795. ErrorCode::ExtraVerificationRequired,
  5796. ErrorCode::InvalidAppKey,
  5797. ErrorCode::ApplicationBanned,
  5798. ];
  5799. values
  5800. }
  5801. fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
  5802. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
  5803. lock: ::protobuf::lazy::ONCE_INIT,
  5804. ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
  5805. };
  5806. unsafe {
  5807. descriptor.get(|| {
  5808. ::protobuf::reflect::EnumDescriptor::new("ErrorCode", file_descriptor_proto())
  5809. })
  5810. }
  5811. }
  5812. }
  5813. impl ::std::marker::Copy for ErrorCode {
  5814. }
  5815. impl ::protobuf::reflect::ProtobufValue for ErrorCode {
  5816. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  5817. ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
  5818. }
  5819. }
  5820. static file_descriptor_proto_data: &'static [u8] = b"\
  5821. \n\x11keyexchange.proto\x12\0\"\xd0\x02\n\x0bClientHello\x12\"\n\nbuild_\
  5822. info\x18\n\x20\x02(\x0b2\n.BuildInfoB\x02\x18\0\x120\n\x16fingerprints_s\
  5823. upported\x18\x14\x20\x03(\x0e2\x0c.FingerprintB\x02\x18\0\x120\n\x16cryp\
  5824. tosuites_supported\x18\x1e\x20\x03(\x0e2\x0c.CryptosuiteB\x02\x18\0\x12,\
  5825. \n\x14powschemes_supported\x18(\x20\x03(\x0e2\n.PowschemeB\x02\x18\0\x12\
  5826. 6\n\x12login_crypto_hello\x182\x20\x02(\x0b2\x16.LoginCryptoHelloUnionB\
  5827. \x02\x18\0\x12\x18\n\x0cclient_nonce\x18<\x20\x02(\x0cB\x02\x18\0\x12\
  5828. \x13\n\x07padding\x18F\x20\x01(\x0cB\x02\x18\0\x12$\n\x0bfeature_set\x18\
  5829. P\x20\x01(\x0b2\x0b.FeatureSetB\x02\x18\0\"\x8a\x01\n\tBuildInfo\x12\x1d\
  5830. \n\x07product\x18\n\x20\x02(\x0e2\x08.ProductB\x02\x18\0\x12(\n\rproduct\
  5831. _flags\x18\x14\x20\x03(\x0e2\r.ProductFlagsB\x02\x18\0\x12\x1f\n\x08plat\
  5832. form\x18\x1e\x20\x02(\x0e2\t.PlatformB\x02\x18\0\x12\x13\n\x07version\
  5833. \x18(\x20\x02(\x04B\x02\x18\0\"S\n\x15LoginCryptoHelloUnion\x12:\n\x0edi\
  5834. ffie_hellman\x18\n\x20\x01(\x0b2\x1e.LoginCryptoDiffieHellmanHelloB\x02\
  5835. \x18\0\"N\n\x1dLoginCryptoDiffieHellmanHello\x12\x0e\n\x02gc\x18\n\x20\
  5836. \x02(\x0cB\x02\x18\0\x12\x1d\n\x11server_keys_known\x18\x14\x20\x02(\rB\
  5837. \x02\x18\0\"C\n\nFeatureSet\x12\x17\n\x0bautoupdate2\x18\x01\x20\x01(\
  5838. \x08B\x02\x18\0\x12\x1c\n\x10current_location\x18\x02\x20\x01(\x08B\x02\
  5839. \x18\0\"\x90\x01\n\x11APResponseMessage\x12#\n\tchallenge\x18\n\x20\x01(\
  5840. \x0b2\x0c.APChallengeB\x02\x18\0\x12,\n\x07upgrade\x18\x14\x20\x01(\x0b2\
  5841. \x17.UpgradeRequiredMessageB\x02\x18\0\x12(\n\x0clogin_failed\x18\x1e\
  5842. \x20\x01(\x0b2\x0e.APLoginFailedB\x02\x18\0\"\x9f\x02\n\x0bAPChallenge\
  5843. \x12>\n\x16login_crypto_challenge\x18\n\x20\x02(\x0b2\x1a.LoginCryptoCha\
  5844. llengeUnionB\x02\x18\0\x12=\n\x15fingerprint_challenge\x18\x14\x20\x02(\
  5845. \x0b2\x1a.FingerprintChallengeUnionB\x02\x18\0\x12-\n\rpow_challenge\x18\
  5846. \x1e\x20\x02(\x0b2\x12.PoWChallengeUnionB\x02\x18\0\x123\n\x10crypto_cha\
  5847. llenge\x18(\x20\x02(\x0b2\x15.CryptoChallengeUnionB\x02\x18\0\x12\x18\n\
  5848. \x0cserver_nonce\x182\x20\x02(\x0cB\x02\x18\0\x12\x13\n\x07padding\x18<\
  5849. \x20\x01(\x0cB\x02\x18\0\"[\n\x19LoginCryptoChallengeUnion\x12>\n\x0edif\
  5850. fie_hellman\x18\n\x20\x01(\x0b2\".LoginCryptoDiffieHellmanChallengeB\x02\
  5851. \x18\0\"o\n!LoginCryptoDiffieHellmanChallenge\x12\x0e\n\x02gs\x18\n\x20\
  5852. \x02(\x0cB\x02\x18\0\x12\x20\n\x14server_signature_key\x18\x14\x20\x02(\
  5853. \x05B\x02\x18\0\x12\x18\n\x0cgs_signature\x18\x1e\x20\x02(\x0cB\x02\x18\
  5854. \0\"\x84\x01\n\x19FingerprintChallengeUnion\x12-\n\x05grain\x18\n\x20\
  5855. \x01(\x0b2\x1a.FingerprintGrainChallengeB\x02\x18\0\x128\n\x0bhmac_ripem\
  5856. d\x18\x14\x20\x01(\x0b2\x1f.FingerprintHmacRipemdChallengeB\x02\x18\0\",\
  5857. \n\x19FingerprintGrainChallenge\x12\x0f\n\x03kek\x18\n\x20\x02(\x0cB\x02\
  5858. \x18\0\"7\n\x1eFingerprintHmacRipemdChallenge\x12\x15\n\tchallenge\x18\n\
  5859. \x20\x02(\x0cB\x02\x18\0\"A\n\x11PoWChallengeUnion\x12,\n\thash_cash\x18\
  5860. \n\x20\x01(\x0b2\x15.PoWHashCashChallengeB\x02\x18\0\"R\n\x14PoWHashCash\
  5861. Challenge\x12\x12\n\x06prefix\x18\n\x20\x01(\x0cB\x02\x18\0\x12\x12\n\
  5862. \x06length\x18\x14\x20\x01(\x05B\x02\x18\0\x12\x12\n\x06target\x18\x1e\
  5863. \x20\x01(\x05B\x02\x18\0\"|\n\x14CryptoChallengeUnion\x12,\n\x07shannon\
  5864. \x18\n\x20\x01(\x0b2\x17.CryptoShannonChallengeB\x02\x18\0\x126\n\rrc4_s\
  5865. ha1_hmac\x18\x14\x20\x01(\x0b2\x1b.CryptoRc4Sha1HmacChallengeB\x02\x18\0\
  5866. \"\x18\n\x16CryptoShannonChallenge\"\x1c\n\x1aCryptoRc4Sha1HmacChallenge\
  5867. \"i\n\x16UpgradeRequiredMessage\x12\x1f\n\x13upgrade_signed_part\x18\n\
  5868. \x20\x02(\x0cB\x02\x18\0\x12\x15\n\tsignature\x18\x14\x20\x02(\x0cB\x02\
  5869. \x18\0\x12\x17\n\x0bhttp_suffix\x18\x1e\x20\x01(\tB\x02\x18\0\"\x7f\n\rA\
  5870. PLoginFailed\x12\"\n\nerror_code\x18\n\x20\x02(\x0e2\n.ErrorCodeB\x02\
  5871. \x18\0\x12\x17\n\x0bretry_delay\x18\x14\x20\x01(\x05B\x02\x18\0\x12\x12\
  5872. \n\x06expiry\x18\x1e\x20\x01(\x05B\x02\x18\0\x12\x1d\n\x11error_descript\
  5873. ion\x18(\x20\x01(\tB\x02\x18\0\"\xb7\x01\n\x17ClientResponsePlaintext\
  5874. \x12<\n\x15login_crypto_response\x18\n\x20\x02(\x0b2\x19.LoginCryptoResp\
  5875. onseUnionB\x02\x18\0\x12+\n\x0cpow_response\x18\x14\x20\x02(\x0b2\x11.Po\
  5876. WResponseUnionB\x02\x18\0\x121\n\x0fcrypto_response\x18\x1e\x20\x02(\x0b\
  5877. 2\x14.CryptoResponseUnionB\x02\x18\0\"Y\n\x18LoginCryptoResponseUnion\
  5878. \x12=\n\x0ediffie_hellman\x18\n\x20\x01(\x0b2!.LoginCryptoDiffieHellmanR\
  5879. esponseB\x02\x18\0\"4\n\x20LoginCryptoDiffieHellmanResponse\x12\x10\n\
  5880. \x04hmac\x18\n\x20\x02(\x0cB\x02\x18\0\"?\n\x10PoWResponseUnion\x12+\n\t\
  5881. hash_cash\x18\n\x20\x01(\x0b2\x14.PoWHashCashResponseB\x02\x18\0\".\n\
  5882. \x13PoWHashCashResponse\x12\x17\n\x0bhash_suffix\x18\n\x20\x02(\x0cB\x02\
  5883. \x18\0\"y\n\x13CryptoResponseUnion\x12+\n\x07shannon\x18\n\x20\x01(\x0b2\
  5884. \x16.CryptoShannonResponseB\x02\x18\0\x125\n\rrc4_sha1_hmac\x18\x14\x20\
  5885. \x01(\x0b2\x1a.CryptoRc4Sha1HmacResponseB\x02\x18\0\"*\n\x15CryptoShanno\
  5886. nResponse\x12\x11\n\x05dummy\x18\x01\x20\x01(\x05B\x02\x18\0\".\n\x19Cry\
  5887. ptoRc4Sha1HmacResponse\x12\x11\n\x05dummy\x18\x01\x20\x01(\x05B\x02\x18\
  5888. \0*\x83\x01\n\x07Product\x12\x12\n\x0ePRODUCT_CLIENT\x10\0\x12\x16\n\x12\
  5889. PRODUCT_LIBSPOTIFY\x10\x01\x12\x12\n\x0ePRODUCT_MOBILE\x10\x02\x12\x13\n\
  5890. \x0fPRODUCT_PARTNER\x10\x03\x12\x1f\n\x1bPRODUCT_LIBSPOTIFY_EMBEDDED\x10\
  5891. \x05\x1a\x02\x10\0*E\n\x0cProductFlags\x12\x15\n\x11PRODUCT_FLAG_NONE\
  5892. \x10\0\x12\x1a\n\x16PRODUCT_FLAG_DEV_BUILD\x10\x01\x1a\x02\x10\0*\xe0\
  5893. \x04\n\x08Platform\x12\x16\n\x12PLATFORM_WIN32_X86\x10\0\x12\x14\n\x10PL\
  5894. ATFORM_OSX_X86\x10\x01\x12\x16\n\x12PLATFORM_LINUX_X86\x10\x02\x12\x17\n\
  5895. \x13PLATFORM_IPHONE_ARM\x10\x03\x12\x14\n\x10PLATFORM_S60_ARM\x10\x04\
  5896. \x12\x14\n\x10PLATFORM_OSX_PPC\x10\x05\x12\x18\n\x14PLATFORM_ANDROID_ARM\
  5897. \x10\x06\x12\x1b\n\x17PLATFORM_WINDOWS_CE_ARM\x10\x07\x12\x19\n\x15PLATF\
  5898. ORM_LINUX_X86_64\x10\x08\x12\x17\n\x13PLATFORM_OSX_X86_64\x10\t\x12\x15\
  5899. \n\x11PLATFORM_PALM_ARM\x10\n\x12\x15\n\x11PLATFORM_LINUX_SH\x10\x0b\x12\
  5900. \x18\n\x14PLATFORM_FREEBSD_X86\x10\x0c\x12\x1b\n\x17PLATFORM_FREEBSD_X86\
  5901. _64\x10\r\x12\x1b\n\x17PLATFORM_BLACKBERRY_ARM\x10\x0e\x12\x12\n\x0ePLAT\
  5902. FORM_SONOS\x10\x0f\x12\x17\n\x13PLATFORM_LINUX_MIPS\x10\x10\x12\x16\n\
  5903. \x12PLATFORM_LINUX_ARM\x10\x11\x12\x19\n\x15PLATFORM_LOGITECH_ARM\x10\
  5904. \x12\x12\x1b\n\x17PLATFORM_LINUX_BLACKFIN\x10\x13\x12\x14\n\x10PLATFORM_\
  5905. WP7_ARM\x10\x14\x12\x16\n\x12PLATFORM_ONKYO_ARM\x10\x15\x12\x17\n\x13PLA\
  5906. TFORM_QNXNTO_ARM\x10\x16\x12\x14\n\x10PLATFORM_BCO_ARM\x10\x17\x1a\x02\
  5907. \x10\0*E\n\x0bFingerprint\x12\x15\n\x11FINGERPRINT_GRAIN\x10\0\x12\x1b\n\
  5908. \x17FINGERPRINT_HMAC_RIPEMD\x10\x01\x1a\x02\x10\0*K\n\x0bCryptosuite\x12\
  5909. \x18\n\x14CRYPTO_SUITE_SHANNON\x10\0\x12\x1e\n\x1aCRYPTO_SUITE_RC4_SHA1_\
  5910. HMAC\x10\x01\x1a\x02\x10\0*\"\n\tPowscheme\x12\x11\n\rPOW_HASH_CASH\x10\
  5911. \0\x1a\x02\x10\0*\x8d\x02\n\tErrorCode\x12\x11\n\rProtocolError\x10\0\
  5912. \x12\x10\n\x0cTryAnotherAP\x10\x02\x12\x13\n\x0fBadConnectionId\x10\x05\
  5913. \x12\x15\n\x11TravelRestriction\x10\t\x12\x1a\n\x16PremiumAccountRequire\
  5914. d\x10\x0b\x12\x12\n\x0eBadCredentials\x10\x0c\x12\x1f\n\x1bCouldNotValid\
  5915. ateCredentials\x10\r\x12\x11\n\rAccountExists\x10\x0e\x12\x1d\n\x19Extra\
  5916. VerificationRequired\x10\x0f\x12\x11\n\rInvalidAppKey\x10\x10\x12\x15\n\
  5917. \x11ApplicationBanned\x10\x11\x1a\x02\x10\0B\0b\x06proto2\
  5918. ";
  5919. static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
  5920. lock: ::protobuf::lazy::ONCE_INIT,
  5921. ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
  5922. };
  5923. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  5924. ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
  5925. }
  5926. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  5927. unsafe {
  5928. file_descriptor_proto_lazy.get(|| {
  5929. parse_descriptor_proto()
  5930. })
  5931. }
  5932. }