keyexchange.rs 231 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824
  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\"\xb2\x03\n\x0bClientHello\x12)\n\nbuild_info\
  5822. \x18\n\x20\x02(\x0b2\n.BuildInfoR\tbuildInfo\x12C\n\x16fingerprints_supp\
  5823. orted\x18\x14\x20\x03(\x0e2\x0c.FingerprintR\x15fingerprintsSupported\
  5824. \x12C\n\x16cryptosuites_supported\x18\x1e\x20\x03(\x0e2\x0c.CryptosuiteR\
  5825. \x15cryptosuitesSupported\x12=\n\x14powschemes_supported\x18(\x20\x03(\
  5826. \x0e2\n.PowschemeR\x13powschemesSupported\x12D\n\x12login_crypto_hello\
  5827. \x182\x20\x02(\x0b2\x16.LoginCryptoHelloUnionR\x10loginCryptoHello\x12!\
  5828. \n\x0cclient_nonce\x18<\x20\x02(\x0cR\x0bclientNonce\x12\x18\n\x07paddin\
  5829. g\x18F\x20\x01(\x0cR\x07padding\x12,\n\x0bfeature_set\x18P\x20\x01(\x0b2\
  5830. \x0b.FeatureSetR\nfeatureSet\"\xa4\x01\n\tBuildInfo\x12\"\n\x07product\
  5831. \x18\n\x20\x02(\x0e2\x08.ProductR\x07product\x122\n\rproduct_flags\x18\
  5832. \x14\x20\x03(\x0e2\r.ProductFlagsR\x0cproductFlags\x12%\n\x08platform\
  5833. \x18\x1e\x20\x02(\x0e2\t.PlatformR\x08platform\x12\x18\n\x07version\x18(\
  5834. \x20\x02(\x04R\x07version\"^\n\x15LoginCryptoHelloUnion\x12E\n\x0ediffie\
  5835. _hellman\x18\n\x20\x01(\x0b2\x1e.LoginCryptoDiffieHellmanHelloR\rdiffieH\
  5836. ellman\"[\n\x1dLoginCryptoDiffieHellmanHello\x12\x0e\n\x02gc\x18\n\x20\
  5837. \x02(\x0cR\x02gc\x12*\n\x11server_keys_known\x18\x14\x20\x02(\rR\x0fserv\
  5838. erKeysKnown\"Y\n\nFeatureSet\x12\x20\n\x0bautoupdate2\x18\x01\x20\x01(\
  5839. \x08R\x0bautoupdate2\x12)\n\x10current_location\x18\x02\x20\x01(\x08R\
  5840. \x0fcurrentLocation\"\xa5\x01\n\x11APResponseMessage\x12*\n\tchallenge\
  5841. \x18\n\x20\x01(\x0b2\x0c.APChallengeR\tchallenge\x121\n\x07upgrade\x18\
  5842. \x14\x20\x01(\x0b2\x17.UpgradeRequiredMessageR\x07upgrade\x121\n\x0clogi\
  5843. n_failed\x18\x1e\x20\x01(\x0b2\x0e.APLoginFailedR\x0bloginFailed\"\xe8\
  5844. \x02\n\x0bAPChallenge\x12P\n\x16login_crypto_challenge\x18\n\x20\x02(\
  5845. \x0b2\x1a.LoginCryptoChallengeUnionR\x14loginCryptoChallenge\x12O\n\x15f\
  5846. ingerprint_challenge\x18\x14\x20\x02(\x0b2\x1a.FingerprintChallengeUnion\
  5847. R\x14fingerprintChallenge\x127\n\rpow_challenge\x18\x1e\x20\x02(\x0b2\
  5848. \x12.PoWChallengeUnionR\x0cpowChallenge\x12@\n\x10crypto_challenge\x18(\
  5849. \x20\x02(\x0b2\x15.CryptoChallengeUnionR\x0fcryptoChallenge\x12!\n\x0cse\
  5850. rver_nonce\x182\x20\x02(\x0cR\x0bserverNonce\x12\x18\n\x07padding\x18<\
  5851. \x20\x01(\x0cR\x07padding\"f\n\x19LoginCryptoChallengeUnion\x12I\n\x0edi\
  5852. ffie_hellman\x18\n\x20\x01(\x0b2\".LoginCryptoDiffieHellmanChallengeR\rd\
  5853. iffieHellman\"\x88\x01\n!LoginCryptoDiffieHellmanChallenge\x12\x0e\n\x02\
  5854. gs\x18\n\x20\x02(\x0cR\x02gs\x120\n\x14server_signature_key\x18\x14\x20\
  5855. \x02(\x05R\x12serverSignatureKey\x12!\n\x0cgs_signature\x18\x1e\x20\x02(\
  5856. \x0cR\x0bgsSignature\"\x8f\x01\n\x19FingerprintChallengeUnion\x120\n\x05\
  5857. grain\x18\n\x20\x01(\x0b2\x1a.FingerprintGrainChallengeR\x05grain\x12@\n\
  5858. \x0bhmac_ripemd\x18\x14\x20\x01(\x0b2\x1f.FingerprintHmacRipemdChallenge\
  5859. R\nhmacRipemd\"-\n\x19FingerprintGrainChallenge\x12\x10\n\x03kek\x18\n\
  5860. \x20\x02(\x0cR\x03kek\">\n\x1eFingerprintHmacRipemdChallenge\x12\x1c\n\t\
  5861. challenge\x18\n\x20\x02(\x0cR\tchallenge\"G\n\x11PoWChallengeUnion\x122\
  5862. \n\thash_cash\x18\n\x20\x01(\x0b2\x15.PoWHashCashChallengeR\x08hashCash\
  5863. \"^\n\x14PoWHashCashChallenge\x12\x16\n\x06prefix\x18\n\x20\x01(\x0cR\
  5864. \x06prefix\x12\x16\n\x06length\x18\x14\x20\x01(\x05R\x06length\x12\x16\n\
  5865. \x06target\x18\x1e\x20\x01(\x05R\x06target\"\x8a\x01\n\x14CryptoChalleng\
  5866. eUnion\x121\n\x07shannon\x18\n\x20\x01(\x0b2\x17.CryptoShannonChallengeR\
  5867. \x07shannon\x12?\n\rrc4_sha1_hmac\x18\x14\x20\x01(\x0b2\x1b.CryptoRc4Sha\
  5868. 1HmacChallengeR\x0brc4Sha1Hmac\"\x18\n\x16CryptoShannonChallenge\"\x1c\n\
  5869. \x1aCryptoRc4Sha1HmacChallenge\"\x87\x01\n\x16UpgradeRequiredMessage\x12\
  5870. .\n\x13upgrade_signed_part\x18\n\x20\x02(\x0cR\x11upgradeSignedPart\x12\
  5871. \x1c\n\tsignature\x18\x14\x20\x02(\x0cR\tsignature\x12\x1f\n\x0bhttp_suf\
  5872. fix\x18\x1e\x20\x01(\tR\nhttpSuffix\"\xa0\x01\n\rAPLoginFailed\x12)\n\ne\
  5873. rror_code\x18\n\x20\x02(\x0e2\n.ErrorCodeR\terrorCode\x12\x1f\n\x0bretry\
  5874. _delay\x18\x14\x20\x01(\x05R\nretryDelay\x12\x16\n\x06expiry\x18\x1e\x20\
  5875. \x01(\x05R\x06expiry\x12+\n\x11error_description\x18(\x20\x01(\tR\x10err\
  5876. orDescription\"\xdd\x01\n\x17ClientResponsePlaintext\x12M\n\x15login_cry\
  5877. pto_response\x18\n\x20\x02(\x0b2\x19.LoginCryptoResponseUnionR\x13loginC\
  5878. ryptoResponse\x124\n\x0cpow_response\x18\x14\x20\x02(\x0b2\x11.PoWRespon\
  5879. seUnionR\x0bpowResponse\x12=\n\x0fcrypto_response\x18\x1e\x20\x02(\x0b2\
  5880. \x14.CryptoResponseUnionR\x0ecryptoResponse\"d\n\x18LoginCryptoResponseU\
  5881. nion\x12H\n\x0ediffie_hellman\x18\n\x20\x01(\x0b2!.LoginCryptoDiffieHell\
  5882. manResponseR\rdiffieHellman\"6\n\x20LoginCryptoDiffieHellmanResponse\x12\
  5883. \x12\n\x04hmac\x18\n\x20\x02(\x0cR\x04hmac\"E\n\x10PoWResponseUnion\x121\
  5884. \n\thash_cash\x18\n\x20\x01(\x0b2\x14.PoWHashCashResponseR\x08hashCash\"\
  5885. 6\n\x13PoWHashCashResponse\x12\x1f\n\x0bhash_suffix\x18\n\x20\x02(\x0cR\
  5886. \nhashSuffix\"\x87\x01\n\x13CryptoResponseUnion\x120\n\x07shannon\x18\n\
  5887. \x20\x01(\x0b2\x16.CryptoShannonResponseR\x07shannon\x12>\n\rrc4_sha1_hm\
  5888. ac\x18\x14\x20\x01(\x0b2\x1a.CryptoRc4Sha1HmacResponseR\x0brc4Sha1Hmac\"\
  5889. -\n\x15CryptoShannonResponse\x12\x14\n\x05dummy\x18\x01\x20\x01(\x05R\
  5890. \x05dummy\"1\n\x19CryptoRc4Sha1HmacResponse\x12\x14\n\x05dummy\x18\x01\
  5891. \x20\x01(\x05R\x05dummy*\x7f\n\x07Product\x12\x12\n\x0ePRODUCT_CLIENT\
  5892. \x10\0\x12\x16\n\x12PRODUCT_LIBSPOTIFY\x10\x01\x12\x12\n\x0ePRODUCT_MOBI\
  5893. LE\x10\x02\x12\x13\n\x0fPRODUCT_PARTNER\x10\x03\x12\x1f\n\x1bPRODUCT_LIB\
  5894. SPOTIFY_EMBEDDED\x10\x05*A\n\x0cProductFlags\x12\x15\n\x11PRODUCT_FLAG_N\
  5895. ONE\x10\0\x12\x1a\n\x16PRODUCT_FLAG_DEV_BUILD\x10\x01*\xdc\x04\n\x08Plat\
  5896. form\x12\x16\n\x12PLATFORM_WIN32_X86\x10\0\x12\x14\n\x10PLATFORM_OSX_X86\
  5897. \x10\x01\x12\x16\n\x12PLATFORM_LINUX_X86\x10\x02\x12\x17\n\x13PLATFORM_I\
  5898. PHONE_ARM\x10\x03\x12\x14\n\x10PLATFORM_S60_ARM\x10\x04\x12\x14\n\x10PLA\
  5899. TFORM_OSX_PPC\x10\x05\x12\x18\n\x14PLATFORM_ANDROID_ARM\x10\x06\x12\x1b\
  5900. \n\x17PLATFORM_WINDOWS_CE_ARM\x10\x07\x12\x19\n\x15PLATFORM_LINUX_X86_64\
  5901. \x10\x08\x12\x17\n\x13PLATFORM_OSX_X86_64\x10\t\x12\x15\n\x11PLATFORM_PA\
  5902. LM_ARM\x10\n\x12\x15\n\x11PLATFORM_LINUX_SH\x10\x0b\x12\x18\n\x14PLATFOR\
  5903. M_FREEBSD_X86\x10\x0c\x12\x1b\n\x17PLATFORM_FREEBSD_X86_64\x10\r\x12\x1b\
  5904. \n\x17PLATFORM_BLACKBERRY_ARM\x10\x0e\x12\x12\n\x0ePLATFORM_SONOS\x10\
  5905. \x0f\x12\x17\n\x13PLATFORM_LINUX_MIPS\x10\x10\x12\x16\n\x12PLATFORM_LINU\
  5906. X_ARM\x10\x11\x12\x19\n\x15PLATFORM_LOGITECH_ARM\x10\x12\x12\x1b\n\x17PL\
  5907. ATFORM_LINUX_BLACKFIN\x10\x13\x12\x14\n\x10PLATFORM_WP7_ARM\x10\x14\x12\
  5908. \x16\n\x12PLATFORM_ONKYO_ARM\x10\x15\x12\x17\n\x13PLATFORM_QNXNTO_ARM\
  5909. \x10\x16\x12\x14\n\x10PLATFORM_BCO_ARM\x10\x17*A\n\x0bFingerprint\x12\
  5910. \x15\n\x11FINGERPRINT_GRAIN\x10\0\x12\x1b\n\x17FINGERPRINT_HMAC_RIPEMD\
  5911. \x10\x01*G\n\x0bCryptosuite\x12\x18\n\x14CRYPTO_SUITE_SHANNON\x10\0\x12\
  5912. \x1e\n\x1aCRYPTO_SUITE_RC4_SHA1_HMAC\x10\x01*\x1e\n\tPowscheme\x12\x11\n\
  5913. \rPOW_HASH_CASH\x10\0*\x89\x02\n\tErrorCode\x12\x11\n\rProtocolError\x10\
  5914. \0\x12\x10\n\x0cTryAnotherAP\x10\x02\x12\x13\n\x0fBadConnectionId\x10\
  5915. \x05\x12\x15\n\x11TravelRestriction\x10\t\x12\x1a\n\x16PremiumAccountReq\
  5916. uired\x10\x0b\x12\x12\n\x0eBadCredentials\x10\x0c\x12\x1f\n\x1bCouldNotV\
  5917. alidateCredentials\x10\r\x12\x11\n\rAccountExists\x10\x0e\x12\x1d\n\x19E\
  5918. xtraVerificationRequired\x10\x0f\x12\x11\n\rInvalidAppKey\x10\x10\x12\
  5919. \x15\n\x11ApplicationBanned\x10\x11\
  5920. ";
  5921. static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
  5922. lock: ::protobuf::lazy::ONCE_INIT,
  5923. ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
  5924. };
  5925. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  5926. ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
  5927. }
  5928. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  5929. unsafe {
  5930. file_descriptor_proto_lazy.get(|| {
  5931. parse_descriptor_proto()
  5932. })
  5933. }
  5934. }