mercury.rs 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093
  1. // This file is generated. 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 MercuryMultiGetRequest {
  21. // message fields
  22. request: ::protobuf::RepeatedField<MercuryRequest>,
  23. // special fields
  24. unknown_fields: ::protobuf::UnknownFields,
  25. cached_size: ::protobuf::CachedSize,
  26. }
  27. // see codegen.rs for the explanation why impl Sync explicitly
  28. unsafe impl ::std::marker::Sync for MercuryMultiGetRequest {}
  29. impl MercuryMultiGetRequest {
  30. pub fn new() -> MercuryMultiGetRequest {
  31. ::std::default::Default::default()
  32. }
  33. pub fn default_instance() -> &'static MercuryMultiGetRequest {
  34. static mut instance: ::protobuf::lazy::Lazy<MercuryMultiGetRequest> = ::protobuf::lazy::Lazy {
  35. lock: ::protobuf::lazy::ONCE_INIT,
  36. ptr: 0 as *const MercuryMultiGetRequest,
  37. };
  38. unsafe {
  39. instance.get(MercuryMultiGetRequest::new)
  40. }
  41. }
  42. // repeated .MercuryRequest request = 1;
  43. pub fn clear_request(&mut self) {
  44. self.request.clear();
  45. }
  46. // Param is passed by value, moved
  47. pub fn set_request(&mut self, v: ::protobuf::RepeatedField<MercuryRequest>) {
  48. self.request = v;
  49. }
  50. // Mutable pointer to the field.
  51. pub fn mut_request(&mut self) -> &mut ::protobuf::RepeatedField<MercuryRequest> {
  52. &mut self.request
  53. }
  54. // Take field
  55. pub fn take_request(&mut self) -> ::protobuf::RepeatedField<MercuryRequest> {
  56. ::std::mem::replace(&mut self.request, ::protobuf::RepeatedField::new())
  57. }
  58. pub fn get_request(&self) -> &[MercuryRequest] {
  59. &self.request
  60. }
  61. fn get_request_for_reflect(&self) -> &::protobuf::RepeatedField<MercuryRequest> {
  62. &self.request
  63. }
  64. fn mut_request_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<MercuryRequest> {
  65. &mut self.request
  66. }
  67. }
  68. impl ::protobuf::Message for MercuryMultiGetRequest {
  69. fn is_initialized(&self) -> bool {
  70. for v in &self.request {
  71. if !v.is_initialized() {
  72. return false;
  73. }
  74. };
  75. true
  76. }
  77. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  78. while !is.eof()? {
  79. let (field_number, wire_type) = is.read_tag_unpack()?;
  80. match field_number {
  81. 1 => {
  82. ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.request)?;
  83. },
  84. _ => {
  85. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  86. },
  87. };
  88. }
  89. ::std::result::Result::Ok(())
  90. }
  91. // Compute sizes of nested messages
  92. #[allow(unused_variables)]
  93. fn compute_size(&self) -> u32 {
  94. let mut my_size = 0;
  95. for value in &self.request {
  96. let len = value.compute_size();
  97. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  98. };
  99. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  100. self.cached_size.set(my_size);
  101. my_size
  102. }
  103. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  104. for v in &self.request {
  105. os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  106. os.write_raw_varint32(v.get_cached_size())?;
  107. v.write_to_with_cached_sizes(os)?;
  108. };
  109. os.write_unknown_fields(self.get_unknown_fields())?;
  110. ::std::result::Result::Ok(())
  111. }
  112. fn get_cached_size(&self) -> u32 {
  113. self.cached_size.get()
  114. }
  115. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  116. &self.unknown_fields
  117. }
  118. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  119. &mut self.unknown_fields
  120. }
  121. fn as_any(&self) -> &::std::any::Any {
  122. self as &::std::any::Any
  123. }
  124. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  125. self as &mut ::std::any::Any
  126. }
  127. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  128. self
  129. }
  130. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  131. ::protobuf::MessageStatic::descriptor_static(None::<Self>)
  132. }
  133. }
  134. impl ::protobuf::MessageStatic for MercuryMultiGetRequest {
  135. fn new() -> MercuryMultiGetRequest {
  136. MercuryMultiGetRequest::new()
  137. }
  138. fn descriptor_static(_: ::std::option::Option<MercuryMultiGetRequest>) -> &'static ::protobuf::reflect::MessageDescriptor {
  139. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  140. lock: ::protobuf::lazy::ONCE_INIT,
  141. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  142. };
  143. unsafe {
  144. descriptor.get(|| {
  145. let mut fields = ::std::vec::Vec::new();
  146. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<MercuryRequest>>(
  147. "request",
  148. MercuryMultiGetRequest::get_request_for_reflect,
  149. MercuryMultiGetRequest::mut_request_for_reflect,
  150. ));
  151. ::protobuf::reflect::MessageDescriptor::new::<MercuryMultiGetRequest>(
  152. "MercuryMultiGetRequest",
  153. fields,
  154. file_descriptor_proto()
  155. )
  156. })
  157. }
  158. }
  159. }
  160. impl ::protobuf::Clear for MercuryMultiGetRequest {
  161. fn clear(&mut self) {
  162. self.clear_request();
  163. self.unknown_fields.clear();
  164. }
  165. }
  166. impl ::std::fmt::Debug for MercuryMultiGetRequest {
  167. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  168. ::protobuf::text_format::fmt(self, f)
  169. }
  170. }
  171. impl ::protobuf::reflect::ProtobufValue for MercuryMultiGetRequest {
  172. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  173. ::protobuf::reflect::ProtobufValueRef::Message(self)
  174. }
  175. }
  176. #[derive(PartialEq,Clone,Default)]
  177. pub struct MercuryMultiGetReply {
  178. // message fields
  179. reply: ::protobuf::RepeatedField<MercuryReply>,
  180. // special fields
  181. unknown_fields: ::protobuf::UnknownFields,
  182. cached_size: ::protobuf::CachedSize,
  183. }
  184. // see codegen.rs for the explanation why impl Sync explicitly
  185. unsafe impl ::std::marker::Sync for MercuryMultiGetReply {}
  186. impl MercuryMultiGetReply {
  187. pub fn new() -> MercuryMultiGetReply {
  188. ::std::default::Default::default()
  189. }
  190. pub fn default_instance() -> &'static MercuryMultiGetReply {
  191. static mut instance: ::protobuf::lazy::Lazy<MercuryMultiGetReply> = ::protobuf::lazy::Lazy {
  192. lock: ::protobuf::lazy::ONCE_INIT,
  193. ptr: 0 as *const MercuryMultiGetReply,
  194. };
  195. unsafe {
  196. instance.get(MercuryMultiGetReply::new)
  197. }
  198. }
  199. // repeated .MercuryReply reply = 1;
  200. pub fn clear_reply(&mut self) {
  201. self.reply.clear();
  202. }
  203. // Param is passed by value, moved
  204. pub fn set_reply(&mut self, v: ::protobuf::RepeatedField<MercuryReply>) {
  205. self.reply = v;
  206. }
  207. // Mutable pointer to the field.
  208. pub fn mut_reply(&mut self) -> &mut ::protobuf::RepeatedField<MercuryReply> {
  209. &mut self.reply
  210. }
  211. // Take field
  212. pub fn take_reply(&mut self) -> ::protobuf::RepeatedField<MercuryReply> {
  213. ::std::mem::replace(&mut self.reply, ::protobuf::RepeatedField::new())
  214. }
  215. pub fn get_reply(&self) -> &[MercuryReply] {
  216. &self.reply
  217. }
  218. fn get_reply_for_reflect(&self) -> &::protobuf::RepeatedField<MercuryReply> {
  219. &self.reply
  220. }
  221. fn mut_reply_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<MercuryReply> {
  222. &mut self.reply
  223. }
  224. }
  225. impl ::protobuf::Message for MercuryMultiGetReply {
  226. fn is_initialized(&self) -> bool {
  227. for v in &self.reply {
  228. if !v.is_initialized() {
  229. return false;
  230. }
  231. };
  232. true
  233. }
  234. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  235. while !is.eof()? {
  236. let (field_number, wire_type) = is.read_tag_unpack()?;
  237. match field_number {
  238. 1 => {
  239. ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.reply)?;
  240. },
  241. _ => {
  242. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  243. },
  244. };
  245. }
  246. ::std::result::Result::Ok(())
  247. }
  248. // Compute sizes of nested messages
  249. #[allow(unused_variables)]
  250. fn compute_size(&self) -> u32 {
  251. let mut my_size = 0;
  252. for value in &self.reply {
  253. let len = value.compute_size();
  254. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  255. };
  256. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  257. self.cached_size.set(my_size);
  258. my_size
  259. }
  260. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  261. for v in &self.reply {
  262. os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  263. os.write_raw_varint32(v.get_cached_size())?;
  264. v.write_to_with_cached_sizes(os)?;
  265. };
  266. os.write_unknown_fields(self.get_unknown_fields())?;
  267. ::std::result::Result::Ok(())
  268. }
  269. fn get_cached_size(&self) -> u32 {
  270. self.cached_size.get()
  271. }
  272. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  273. &self.unknown_fields
  274. }
  275. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  276. &mut self.unknown_fields
  277. }
  278. fn as_any(&self) -> &::std::any::Any {
  279. self as &::std::any::Any
  280. }
  281. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  282. self as &mut ::std::any::Any
  283. }
  284. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  285. self
  286. }
  287. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  288. ::protobuf::MessageStatic::descriptor_static(None::<Self>)
  289. }
  290. }
  291. impl ::protobuf::MessageStatic for MercuryMultiGetReply {
  292. fn new() -> MercuryMultiGetReply {
  293. MercuryMultiGetReply::new()
  294. }
  295. fn descriptor_static(_: ::std::option::Option<MercuryMultiGetReply>) -> &'static ::protobuf::reflect::MessageDescriptor {
  296. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  297. lock: ::protobuf::lazy::ONCE_INIT,
  298. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  299. };
  300. unsafe {
  301. descriptor.get(|| {
  302. let mut fields = ::std::vec::Vec::new();
  303. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<MercuryReply>>(
  304. "reply",
  305. MercuryMultiGetReply::get_reply_for_reflect,
  306. MercuryMultiGetReply::mut_reply_for_reflect,
  307. ));
  308. ::protobuf::reflect::MessageDescriptor::new::<MercuryMultiGetReply>(
  309. "MercuryMultiGetReply",
  310. fields,
  311. file_descriptor_proto()
  312. )
  313. })
  314. }
  315. }
  316. }
  317. impl ::protobuf::Clear for MercuryMultiGetReply {
  318. fn clear(&mut self) {
  319. self.clear_reply();
  320. self.unknown_fields.clear();
  321. }
  322. }
  323. impl ::std::fmt::Debug for MercuryMultiGetReply {
  324. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  325. ::protobuf::text_format::fmt(self, f)
  326. }
  327. }
  328. impl ::protobuf::reflect::ProtobufValue for MercuryMultiGetReply {
  329. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  330. ::protobuf::reflect::ProtobufValueRef::Message(self)
  331. }
  332. }
  333. #[derive(PartialEq,Clone,Default)]
  334. pub struct MercuryRequest {
  335. // message fields
  336. uri: ::protobuf::SingularField<::std::string::String>,
  337. content_type: ::protobuf::SingularField<::std::string::String>,
  338. body: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  339. etag: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  340. // special fields
  341. unknown_fields: ::protobuf::UnknownFields,
  342. cached_size: ::protobuf::CachedSize,
  343. }
  344. // see codegen.rs for the explanation why impl Sync explicitly
  345. unsafe impl ::std::marker::Sync for MercuryRequest {}
  346. impl MercuryRequest {
  347. pub fn new() -> MercuryRequest {
  348. ::std::default::Default::default()
  349. }
  350. pub fn default_instance() -> &'static MercuryRequest {
  351. static mut instance: ::protobuf::lazy::Lazy<MercuryRequest> = ::protobuf::lazy::Lazy {
  352. lock: ::protobuf::lazy::ONCE_INIT,
  353. ptr: 0 as *const MercuryRequest,
  354. };
  355. unsafe {
  356. instance.get(MercuryRequest::new)
  357. }
  358. }
  359. // optional string uri = 1;
  360. pub fn clear_uri(&mut self) {
  361. self.uri.clear();
  362. }
  363. pub fn has_uri(&self) -> bool {
  364. self.uri.is_some()
  365. }
  366. // Param is passed by value, moved
  367. pub fn set_uri(&mut self, v: ::std::string::String) {
  368. self.uri = ::protobuf::SingularField::some(v);
  369. }
  370. // Mutable pointer to the field.
  371. // If field is not initialized, it is initialized with default value first.
  372. pub fn mut_uri(&mut self) -> &mut ::std::string::String {
  373. if self.uri.is_none() {
  374. self.uri.set_default();
  375. }
  376. self.uri.as_mut().unwrap()
  377. }
  378. // Take field
  379. pub fn take_uri(&mut self) -> ::std::string::String {
  380. self.uri.take().unwrap_or_else(|| ::std::string::String::new())
  381. }
  382. pub fn get_uri(&self) -> &str {
  383. match self.uri.as_ref() {
  384. Some(v) => &v,
  385. None => "",
  386. }
  387. }
  388. fn get_uri_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> {
  389. &self.uri
  390. }
  391. fn mut_uri_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> {
  392. &mut self.uri
  393. }
  394. // optional string content_type = 2;
  395. pub fn clear_content_type(&mut self) {
  396. self.content_type.clear();
  397. }
  398. pub fn has_content_type(&self) -> bool {
  399. self.content_type.is_some()
  400. }
  401. // Param is passed by value, moved
  402. pub fn set_content_type(&mut self, v: ::std::string::String) {
  403. self.content_type = ::protobuf::SingularField::some(v);
  404. }
  405. // Mutable pointer to the field.
  406. // If field is not initialized, it is initialized with default value first.
  407. pub fn mut_content_type(&mut self) -> &mut ::std::string::String {
  408. if self.content_type.is_none() {
  409. self.content_type.set_default();
  410. }
  411. self.content_type.as_mut().unwrap()
  412. }
  413. // Take field
  414. pub fn take_content_type(&mut self) -> ::std::string::String {
  415. self.content_type.take().unwrap_or_else(|| ::std::string::String::new())
  416. }
  417. pub fn get_content_type(&self) -> &str {
  418. match self.content_type.as_ref() {
  419. Some(v) => &v,
  420. None => "",
  421. }
  422. }
  423. fn get_content_type_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> {
  424. &self.content_type
  425. }
  426. fn mut_content_type_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> {
  427. &mut self.content_type
  428. }
  429. // optional bytes body = 3;
  430. pub fn clear_body(&mut self) {
  431. self.body.clear();
  432. }
  433. pub fn has_body(&self) -> bool {
  434. self.body.is_some()
  435. }
  436. // Param is passed by value, moved
  437. pub fn set_body(&mut self, v: ::std::vec::Vec<u8>) {
  438. self.body = ::protobuf::SingularField::some(v);
  439. }
  440. // Mutable pointer to the field.
  441. // If field is not initialized, it is initialized with default value first.
  442. pub fn mut_body(&mut self) -> &mut ::std::vec::Vec<u8> {
  443. if self.body.is_none() {
  444. self.body.set_default();
  445. }
  446. self.body.as_mut().unwrap()
  447. }
  448. // Take field
  449. pub fn take_body(&mut self) -> ::std::vec::Vec<u8> {
  450. self.body.take().unwrap_or_else(|| ::std::vec::Vec::new())
  451. }
  452. pub fn get_body(&self) -> &[u8] {
  453. match self.body.as_ref() {
  454. Some(v) => &v,
  455. None => &[],
  456. }
  457. }
  458. fn get_body_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec<u8>> {
  459. &self.body
  460. }
  461. fn mut_body_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec<u8>> {
  462. &mut self.body
  463. }
  464. // optional bytes etag = 4;
  465. pub fn clear_etag(&mut self) {
  466. self.etag.clear();
  467. }
  468. pub fn has_etag(&self) -> bool {
  469. self.etag.is_some()
  470. }
  471. // Param is passed by value, moved
  472. pub fn set_etag(&mut self, v: ::std::vec::Vec<u8>) {
  473. self.etag = ::protobuf::SingularField::some(v);
  474. }
  475. // Mutable pointer to the field.
  476. // If field is not initialized, it is initialized with default value first.
  477. pub fn mut_etag(&mut self) -> &mut ::std::vec::Vec<u8> {
  478. if self.etag.is_none() {
  479. self.etag.set_default();
  480. }
  481. self.etag.as_mut().unwrap()
  482. }
  483. // Take field
  484. pub fn take_etag(&mut self) -> ::std::vec::Vec<u8> {
  485. self.etag.take().unwrap_or_else(|| ::std::vec::Vec::new())
  486. }
  487. pub fn get_etag(&self) -> &[u8] {
  488. match self.etag.as_ref() {
  489. Some(v) => &v,
  490. None => &[],
  491. }
  492. }
  493. fn get_etag_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec<u8>> {
  494. &self.etag
  495. }
  496. fn mut_etag_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec<u8>> {
  497. &mut self.etag
  498. }
  499. }
  500. impl ::protobuf::Message for MercuryRequest {
  501. fn is_initialized(&self) -> bool {
  502. true
  503. }
  504. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  505. while !is.eof()? {
  506. let (field_number, wire_type) = is.read_tag_unpack()?;
  507. match field_number {
  508. 1 => {
  509. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)?;
  510. },
  511. 2 => {
  512. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.content_type)?;
  513. },
  514. 3 => {
  515. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.body)?;
  516. },
  517. 4 => {
  518. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.etag)?;
  519. },
  520. _ => {
  521. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  522. },
  523. };
  524. }
  525. ::std::result::Result::Ok(())
  526. }
  527. // Compute sizes of nested messages
  528. #[allow(unused_variables)]
  529. fn compute_size(&self) -> u32 {
  530. let mut my_size = 0;
  531. if let Some(ref v) = self.uri.as_ref() {
  532. my_size += ::protobuf::rt::string_size(1, &v);
  533. }
  534. if let Some(ref v) = self.content_type.as_ref() {
  535. my_size += ::protobuf::rt::string_size(2, &v);
  536. }
  537. if let Some(ref v) = self.body.as_ref() {
  538. my_size += ::protobuf::rt::bytes_size(3, &v);
  539. }
  540. if let Some(ref v) = self.etag.as_ref() {
  541. my_size += ::protobuf::rt::bytes_size(4, &v);
  542. }
  543. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  544. self.cached_size.set(my_size);
  545. my_size
  546. }
  547. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  548. if let Some(ref v) = self.uri.as_ref() {
  549. os.write_string(1, &v)?;
  550. }
  551. if let Some(ref v) = self.content_type.as_ref() {
  552. os.write_string(2, &v)?;
  553. }
  554. if let Some(ref v) = self.body.as_ref() {
  555. os.write_bytes(3, &v)?;
  556. }
  557. if let Some(ref v) = self.etag.as_ref() {
  558. os.write_bytes(4, &v)?;
  559. }
  560. os.write_unknown_fields(self.get_unknown_fields())?;
  561. ::std::result::Result::Ok(())
  562. }
  563. fn get_cached_size(&self) -> u32 {
  564. self.cached_size.get()
  565. }
  566. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  567. &self.unknown_fields
  568. }
  569. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  570. &mut self.unknown_fields
  571. }
  572. fn as_any(&self) -> &::std::any::Any {
  573. self as &::std::any::Any
  574. }
  575. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  576. self as &mut ::std::any::Any
  577. }
  578. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  579. self
  580. }
  581. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  582. ::protobuf::MessageStatic::descriptor_static(None::<Self>)
  583. }
  584. }
  585. impl ::protobuf::MessageStatic for MercuryRequest {
  586. fn new() -> MercuryRequest {
  587. MercuryRequest::new()
  588. }
  589. fn descriptor_static(_: ::std::option::Option<MercuryRequest>) -> &'static ::protobuf::reflect::MessageDescriptor {
  590. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  591. lock: ::protobuf::lazy::ONCE_INIT,
  592. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  593. };
  594. unsafe {
  595. descriptor.get(|| {
  596. let mut fields = ::std::vec::Vec::new();
  597. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  598. "uri",
  599. MercuryRequest::get_uri_for_reflect,
  600. MercuryRequest::mut_uri_for_reflect,
  601. ));
  602. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  603. "content_type",
  604. MercuryRequest::get_content_type_for_reflect,
  605. MercuryRequest::mut_content_type_for_reflect,
  606. ));
  607. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  608. "body",
  609. MercuryRequest::get_body_for_reflect,
  610. MercuryRequest::mut_body_for_reflect,
  611. ));
  612. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  613. "etag",
  614. MercuryRequest::get_etag_for_reflect,
  615. MercuryRequest::mut_etag_for_reflect,
  616. ));
  617. ::protobuf::reflect::MessageDescriptor::new::<MercuryRequest>(
  618. "MercuryRequest",
  619. fields,
  620. file_descriptor_proto()
  621. )
  622. })
  623. }
  624. }
  625. }
  626. impl ::protobuf::Clear for MercuryRequest {
  627. fn clear(&mut self) {
  628. self.clear_uri();
  629. self.clear_content_type();
  630. self.clear_body();
  631. self.clear_etag();
  632. self.unknown_fields.clear();
  633. }
  634. }
  635. impl ::std::fmt::Debug for MercuryRequest {
  636. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  637. ::protobuf::text_format::fmt(self, f)
  638. }
  639. }
  640. impl ::protobuf::reflect::ProtobufValue for MercuryRequest {
  641. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  642. ::protobuf::reflect::ProtobufValueRef::Message(self)
  643. }
  644. }
  645. #[derive(PartialEq,Clone,Default)]
  646. pub struct MercuryReply {
  647. // message fields
  648. status_code: ::std::option::Option<i32>,
  649. status_message: ::protobuf::SingularField<::std::string::String>,
  650. cache_policy: ::std::option::Option<MercuryReply_CachePolicy>,
  651. ttl: ::std::option::Option<i32>,
  652. etag: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  653. content_type: ::protobuf::SingularField<::std::string::String>,
  654. body: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  655. // special fields
  656. unknown_fields: ::protobuf::UnknownFields,
  657. cached_size: ::protobuf::CachedSize,
  658. }
  659. // see codegen.rs for the explanation why impl Sync explicitly
  660. unsafe impl ::std::marker::Sync for MercuryReply {}
  661. impl MercuryReply {
  662. pub fn new() -> MercuryReply {
  663. ::std::default::Default::default()
  664. }
  665. pub fn default_instance() -> &'static MercuryReply {
  666. static mut instance: ::protobuf::lazy::Lazy<MercuryReply> = ::protobuf::lazy::Lazy {
  667. lock: ::protobuf::lazy::ONCE_INIT,
  668. ptr: 0 as *const MercuryReply,
  669. };
  670. unsafe {
  671. instance.get(MercuryReply::new)
  672. }
  673. }
  674. // optional sint32 status_code = 1;
  675. pub fn clear_status_code(&mut self) {
  676. self.status_code = ::std::option::Option::None;
  677. }
  678. pub fn has_status_code(&self) -> bool {
  679. self.status_code.is_some()
  680. }
  681. // Param is passed by value, moved
  682. pub fn set_status_code(&mut self, v: i32) {
  683. self.status_code = ::std::option::Option::Some(v);
  684. }
  685. pub fn get_status_code(&self) -> i32 {
  686. self.status_code.unwrap_or(0)
  687. }
  688. fn get_status_code_for_reflect(&self) -> &::std::option::Option<i32> {
  689. &self.status_code
  690. }
  691. fn mut_status_code_for_reflect(&mut self) -> &mut ::std::option::Option<i32> {
  692. &mut self.status_code
  693. }
  694. // optional string status_message = 2;
  695. pub fn clear_status_message(&mut self) {
  696. self.status_message.clear();
  697. }
  698. pub fn has_status_message(&self) -> bool {
  699. self.status_message.is_some()
  700. }
  701. // Param is passed by value, moved
  702. pub fn set_status_message(&mut self, v: ::std::string::String) {
  703. self.status_message = ::protobuf::SingularField::some(v);
  704. }
  705. // Mutable pointer to the field.
  706. // If field is not initialized, it is initialized with default value first.
  707. pub fn mut_status_message(&mut self) -> &mut ::std::string::String {
  708. if self.status_message.is_none() {
  709. self.status_message.set_default();
  710. }
  711. self.status_message.as_mut().unwrap()
  712. }
  713. // Take field
  714. pub fn take_status_message(&mut self) -> ::std::string::String {
  715. self.status_message.take().unwrap_or_else(|| ::std::string::String::new())
  716. }
  717. pub fn get_status_message(&self) -> &str {
  718. match self.status_message.as_ref() {
  719. Some(v) => &v,
  720. None => "",
  721. }
  722. }
  723. fn get_status_message_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> {
  724. &self.status_message
  725. }
  726. fn mut_status_message_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> {
  727. &mut self.status_message
  728. }
  729. // optional .MercuryReply.CachePolicy cache_policy = 3;
  730. pub fn clear_cache_policy(&mut self) {
  731. self.cache_policy = ::std::option::Option::None;
  732. }
  733. pub fn has_cache_policy(&self) -> bool {
  734. self.cache_policy.is_some()
  735. }
  736. // Param is passed by value, moved
  737. pub fn set_cache_policy(&mut self, v: MercuryReply_CachePolicy) {
  738. self.cache_policy = ::std::option::Option::Some(v);
  739. }
  740. pub fn get_cache_policy(&self) -> MercuryReply_CachePolicy {
  741. self.cache_policy.unwrap_or(MercuryReply_CachePolicy::CACHE_NO)
  742. }
  743. fn get_cache_policy_for_reflect(&self) -> &::std::option::Option<MercuryReply_CachePolicy> {
  744. &self.cache_policy
  745. }
  746. fn mut_cache_policy_for_reflect(&mut self) -> &mut ::std::option::Option<MercuryReply_CachePolicy> {
  747. &mut self.cache_policy
  748. }
  749. // optional sint32 ttl = 4;
  750. pub fn clear_ttl(&mut self) {
  751. self.ttl = ::std::option::Option::None;
  752. }
  753. pub fn has_ttl(&self) -> bool {
  754. self.ttl.is_some()
  755. }
  756. // Param is passed by value, moved
  757. pub fn set_ttl(&mut self, v: i32) {
  758. self.ttl = ::std::option::Option::Some(v);
  759. }
  760. pub fn get_ttl(&self) -> i32 {
  761. self.ttl.unwrap_or(0)
  762. }
  763. fn get_ttl_for_reflect(&self) -> &::std::option::Option<i32> {
  764. &self.ttl
  765. }
  766. fn mut_ttl_for_reflect(&mut self) -> &mut ::std::option::Option<i32> {
  767. &mut self.ttl
  768. }
  769. // optional bytes etag = 5;
  770. pub fn clear_etag(&mut self) {
  771. self.etag.clear();
  772. }
  773. pub fn has_etag(&self) -> bool {
  774. self.etag.is_some()
  775. }
  776. // Param is passed by value, moved
  777. pub fn set_etag(&mut self, v: ::std::vec::Vec<u8>) {
  778. self.etag = ::protobuf::SingularField::some(v);
  779. }
  780. // Mutable pointer to the field.
  781. // If field is not initialized, it is initialized with default value first.
  782. pub fn mut_etag(&mut self) -> &mut ::std::vec::Vec<u8> {
  783. if self.etag.is_none() {
  784. self.etag.set_default();
  785. }
  786. self.etag.as_mut().unwrap()
  787. }
  788. // Take field
  789. pub fn take_etag(&mut self) -> ::std::vec::Vec<u8> {
  790. self.etag.take().unwrap_or_else(|| ::std::vec::Vec::new())
  791. }
  792. pub fn get_etag(&self) -> &[u8] {
  793. match self.etag.as_ref() {
  794. Some(v) => &v,
  795. None => &[],
  796. }
  797. }
  798. fn get_etag_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec<u8>> {
  799. &self.etag
  800. }
  801. fn mut_etag_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec<u8>> {
  802. &mut self.etag
  803. }
  804. // optional string content_type = 6;
  805. pub fn clear_content_type(&mut self) {
  806. self.content_type.clear();
  807. }
  808. pub fn has_content_type(&self) -> bool {
  809. self.content_type.is_some()
  810. }
  811. // Param is passed by value, moved
  812. pub fn set_content_type(&mut self, v: ::std::string::String) {
  813. self.content_type = ::protobuf::SingularField::some(v);
  814. }
  815. // Mutable pointer to the field.
  816. // If field is not initialized, it is initialized with default value first.
  817. pub fn mut_content_type(&mut self) -> &mut ::std::string::String {
  818. if self.content_type.is_none() {
  819. self.content_type.set_default();
  820. }
  821. self.content_type.as_mut().unwrap()
  822. }
  823. // Take field
  824. pub fn take_content_type(&mut self) -> ::std::string::String {
  825. self.content_type.take().unwrap_or_else(|| ::std::string::String::new())
  826. }
  827. pub fn get_content_type(&self) -> &str {
  828. match self.content_type.as_ref() {
  829. Some(v) => &v,
  830. None => "",
  831. }
  832. }
  833. fn get_content_type_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> {
  834. &self.content_type
  835. }
  836. fn mut_content_type_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> {
  837. &mut self.content_type
  838. }
  839. // optional bytes body = 7;
  840. pub fn clear_body(&mut self) {
  841. self.body.clear();
  842. }
  843. pub fn has_body(&self) -> bool {
  844. self.body.is_some()
  845. }
  846. // Param is passed by value, moved
  847. pub fn set_body(&mut self, v: ::std::vec::Vec<u8>) {
  848. self.body = ::protobuf::SingularField::some(v);
  849. }
  850. // Mutable pointer to the field.
  851. // If field is not initialized, it is initialized with default value first.
  852. pub fn mut_body(&mut self) -> &mut ::std::vec::Vec<u8> {
  853. if self.body.is_none() {
  854. self.body.set_default();
  855. }
  856. self.body.as_mut().unwrap()
  857. }
  858. // Take field
  859. pub fn take_body(&mut self) -> ::std::vec::Vec<u8> {
  860. self.body.take().unwrap_or_else(|| ::std::vec::Vec::new())
  861. }
  862. pub fn get_body(&self) -> &[u8] {
  863. match self.body.as_ref() {
  864. Some(v) => &v,
  865. None => &[],
  866. }
  867. }
  868. fn get_body_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec<u8>> {
  869. &self.body
  870. }
  871. fn mut_body_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec<u8>> {
  872. &mut self.body
  873. }
  874. }
  875. impl ::protobuf::Message for MercuryReply {
  876. fn is_initialized(&self) -> bool {
  877. true
  878. }
  879. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  880. while !is.eof()? {
  881. let (field_number, wire_type) = is.read_tag_unpack()?;
  882. match field_number {
  883. 1 => {
  884. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  885. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  886. }
  887. let tmp = is.read_sint32()?;
  888. self.status_code = ::std::option::Option::Some(tmp);
  889. },
  890. 2 => {
  891. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.status_message)?;
  892. },
  893. 3 => {
  894. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  895. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  896. }
  897. let tmp = is.read_enum()?;
  898. self.cache_policy = ::std::option::Option::Some(tmp);
  899. },
  900. 4 => {
  901. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  902. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  903. }
  904. let tmp = is.read_sint32()?;
  905. self.ttl = ::std::option::Option::Some(tmp);
  906. },
  907. 5 => {
  908. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.etag)?;
  909. },
  910. 6 => {
  911. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.content_type)?;
  912. },
  913. 7 => {
  914. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.body)?;
  915. },
  916. _ => {
  917. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  918. },
  919. };
  920. }
  921. ::std::result::Result::Ok(())
  922. }
  923. // Compute sizes of nested messages
  924. #[allow(unused_variables)]
  925. fn compute_size(&self) -> u32 {
  926. let mut my_size = 0;
  927. if let Some(v) = self.status_code {
  928. my_size += ::protobuf::rt::value_varint_zigzag_size(1, v);
  929. }
  930. if let Some(ref v) = self.status_message.as_ref() {
  931. my_size += ::protobuf::rt::string_size(2, &v);
  932. }
  933. if let Some(v) = self.cache_policy {
  934. my_size += ::protobuf::rt::enum_size(3, v);
  935. }
  936. if let Some(v) = self.ttl {
  937. my_size += ::protobuf::rt::value_varint_zigzag_size(4, v);
  938. }
  939. if let Some(ref v) = self.etag.as_ref() {
  940. my_size += ::protobuf::rt::bytes_size(5, &v);
  941. }
  942. if let Some(ref v) = self.content_type.as_ref() {
  943. my_size += ::protobuf::rt::string_size(6, &v);
  944. }
  945. if let Some(ref v) = self.body.as_ref() {
  946. my_size += ::protobuf::rt::bytes_size(7, &v);
  947. }
  948. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  949. self.cached_size.set(my_size);
  950. my_size
  951. }
  952. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  953. if let Some(v) = self.status_code {
  954. os.write_sint32(1, v)?;
  955. }
  956. if let Some(ref v) = self.status_message.as_ref() {
  957. os.write_string(2, &v)?;
  958. }
  959. if let Some(v) = self.cache_policy {
  960. os.write_enum(3, v.value())?;
  961. }
  962. if let Some(v) = self.ttl {
  963. os.write_sint32(4, v)?;
  964. }
  965. if let Some(ref v) = self.etag.as_ref() {
  966. os.write_bytes(5, &v)?;
  967. }
  968. if let Some(ref v) = self.content_type.as_ref() {
  969. os.write_string(6, &v)?;
  970. }
  971. if let Some(ref v) = self.body.as_ref() {
  972. os.write_bytes(7, &v)?;
  973. }
  974. os.write_unknown_fields(self.get_unknown_fields())?;
  975. ::std::result::Result::Ok(())
  976. }
  977. fn get_cached_size(&self) -> u32 {
  978. self.cached_size.get()
  979. }
  980. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  981. &self.unknown_fields
  982. }
  983. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  984. &mut self.unknown_fields
  985. }
  986. fn as_any(&self) -> &::std::any::Any {
  987. self as &::std::any::Any
  988. }
  989. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  990. self as &mut ::std::any::Any
  991. }
  992. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  993. self
  994. }
  995. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  996. ::protobuf::MessageStatic::descriptor_static(None::<Self>)
  997. }
  998. }
  999. impl ::protobuf::MessageStatic for MercuryReply {
  1000. fn new() -> MercuryReply {
  1001. MercuryReply::new()
  1002. }
  1003. fn descriptor_static(_: ::std::option::Option<MercuryReply>) -> &'static ::protobuf::reflect::MessageDescriptor {
  1004. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  1005. lock: ::protobuf::lazy::ONCE_INIT,
  1006. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  1007. };
  1008. unsafe {
  1009. descriptor.get(|| {
  1010. let mut fields = ::std::vec::Vec::new();
  1011. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>(
  1012. "status_code",
  1013. MercuryReply::get_status_code_for_reflect,
  1014. MercuryReply::mut_status_code_for_reflect,
  1015. ));
  1016. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1017. "status_message",
  1018. MercuryReply::get_status_message_for_reflect,
  1019. MercuryReply::mut_status_message_for_reflect,
  1020. ));
  1021. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum<MercuryReply_CachePolicy>>(
  1022. "cache_policy",
  1023. MercuryReply::get_cache_policy_for_reflect,
  1024. MercuryReply::mut_cache_policy_for_reflect,
  1025. ));
  1026. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>(
  1027. "ttl",
  1028. MercuryReply::get_ttl_for_reflect,
  1029. MercuryReply::mut_ttl_for_reflect,
  1030. ));
  1031. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  1032. "etag",
  1033. MercuryReply::get_etag_for_reflect,
  1034. MercuryReply::mut_etag_for_reflect,
  1035. ));
  1036. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1037. "content_type",
  1038. MercuryReply::get_content_type_for_reflect,
  1039. MercuryReply::mut_content_type_for_reflect,
  1040. ));
  1041. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  1042. "body",
  1043. MercuryReply::get_body_for_reflect,
  1044. MercuryReply::mut_body_for_reflect,
  1045. ));
  1046. ::protobuf::reflect::MessageDescriptor::new::<MercuryReply>(
  1047. "MercuryReply",
  1048. fields,
  1049. file_descriptor_proto()
  1050. )
  1051. })
  1052. }
  1053. }
  1054. }
  1055. impl ::protobuf::Clear for MercuryReply {
  1056. fn clear(&mut self) {
  1057. self.clear_status_code();
  1058. self.clear_status_message();
  1059. self.clear_cache_policy();
  1060. self.clear_ttl();
  1061. self.clear_etag();
  1062. self.clear_content_type();
  1063. self.clear_body();
  1064. self.unknown_fields.clear();
  1065. }
  1066. }
  1067. impl ::std::fmt::Debug for MercuryReply {
  1068. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  1069. ::protobuf::text_format::fmt(self, f)
  1070. }
  1071. }
  1072. impl ::protobuf::reflect::ProtobufValue for MercuryReply {
  1073. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  1074. ::protobuf::reflect::ProtobufValueRef::Message(self)
  1075. }
  1076. }
  1077. #[derive(Clone,PartialEq,Eq,Debug,Hash)]
  1078. pub enum MercuryReply_CachePolicy {
  1079. CACHE_NO = 1,
  1080. CACHE_PRIVATE = 2,
  1081. CACHE_PUBLIC = 3,
  1082. }
  1083. impl ::protobuf::ProtobufEnum for MercuryReply_CachePolicy {
  1084. fn value(&self) -> i32 {
  1085. *self as i32
  1086. }
  1087. fn from_i32(value: i32) -> ::std::option::Option<MercuryReply_CachePolicy> {
  1088. match value {
  1089. 1 => ::std::option::Option::Some(MercuryReply_CachePolicy::CACHE_NO),
  1090. 2 => ::std::option::Option::Some(MercuryReply_CachePolicy::CACHE_PRIVATE),
  1091. 3 => ::std::option::Option::Some(MercuryReply_CachePolicy::CACHE_PUBLIC),
  1092. _ => ::std::option::Option::None
  1093. }
  1094. }
  1095. fn values() -> &'static [Self] {
  1096. static values: &'static [MercuryReply_CachePolicy] = &[
  1097. MercuryReply_CachePolicy::CACHE_NO,
  1098. MercuryReply_CachePolicy::CACHE_PRIVATE,
  1099. MercuryReply_CachePolicy::CACHE_PUBLIC,
  1100. ];
  1101. values
  1102. }
  1103. fn enum_descriptor_static(_: ::std::option::Option<MercuryReply_CachePolicy>) -> &'static ::protobuf::reflect::EnumDescriptor {
  1104. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
  1105. lock: ::protobuf::lazy::ONCE_INIT,
  1106. ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
  1107. };
  1108. unsafe {
  1109. descriptor.get(|| {
  1110. ::protobuf::reflect::EnumDescriptor::new("MercuryReply_CachePolicy", file_descriptor_proto())
  1111. })
  1112. }
  1113. }
  1114. }
  1115. impl ::std::marker::Copy for MercuryReply_CachePolicy {
  1116. }
  1117. impl ::protobuf::reflect::ProtobufValue for MercuryReply_CachePolicy {
  1118. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  1119. ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
  1120. }
  1121. }
  1122. #[derive(PartialEq,Clone,Default)]
  1123. pub struct Header {
  1124. // message fields
  1125. uri: ::protobuf::SingularField<::std::string::String>,
  1126. content_type: ::protobuf::SingularField<::std::string::String>,
  1127. method: ::protobuf::SingularField<::std::string::String>,
  1128. status_code: ::std::option::Option<i32>,
  1129. user_fields: ::protobuf::RepeatedField<UserField>,
  1130. // special fields
  1131. unknown_fields: ::protobuf::UnknownFields,
  1132. cached_size: ::protobuf::CachedSize,
  1133. }
  1134. // see codegen.rs for the explanation why impl Sync explicitly
  1135. unsafe impl ::std::marker::Sync for Header {}
  1136. impl Header {
  1137. pub fn new() -> Header {
  1138. ::std::default::Default::default()
  1139. }
  1140. pub fn default_instance() -> &'static Header {
  1141. static mut instance: ::protobuf::lazy::Lazy<Header> = ::protobuf::lazy::Lazy {
  1142. lock: ::protobuf::lazy::ONCE_INIT,
  1143. ptr: 0 as *const Header,
  1144. };
  1145. unsafe {
  1146. instance.get(Header::new)
  1147. }
  1148. }
  1149. // optional string uri = 1;
  1150. pub fn clear_uri(&mut self) {
  1151. self.uri.clear();
  1152. }
  1153. pub fn has_uri(&self) -> bool {
  1154. self.uri.is_some()
  1155. }
  1156. // Param is passed by value, moved
  1157. pub fn set_uri(&mut self, v: ::std::string::String) {
  1158. self.uri = ::protobuf::SingularField::some(v);
  1159. }
  1160. // Mutable pointer to the field.
  1161. // If field is not initialized, it is initialized with default value first.
  1162. pub fn mut_uri(&mut self) -> &mut ::std::string::String {
  1163. if self.uri.is_none() {
  1164. self.uri.set_default();
  1165. }
  1166. self.uri.as_mut().unwrap()
  1167. }
  1168. // Take field
  1169. pub fn take_uri(&mut self) -> ::std::string::String {
  1170. self.uri.take().unwrap_or_else(|| ::std::string::String::new())
  1171. }
  1172. pub fn get_uri(&self) -> &str {
  1173. match self.uri.as_ref() {
  1174. Some(v) => &v,
  1175. None => "",
  1176. }
  1177. }
  1178. fn get_uri_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> {
  1179. &self.uri
  1180. }
  1181. fn mut_uri_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> {
  1182. &mut self.uri
  1183. }
  1184. // optional string content_type = 2;
  1185. pub fn clear_content_type(&mut self) {
  1186. self.content_type.clear();
  1187. }
  1188. pub fn has_content_type(&self) -> bool {
  1189. self.content_type.is_some()
  1190. }
  1191. // Param is passed by value, moved
  1192. pub fn set_content_type(&mut self, v: ::std::string::String) {
  1193. self.content_type = ::protobuf::SingularField::some(v);
  1194. }
  1195. // Mutable pointer to the field.
  1196. // If field is not initialized, it is initialized with default value first.
  1197. pub fn mut_content_type(&mut self) -> &mut ::std::string::String {
  1198. if self.content_type.is_none() {
  1199. self.content_type.set_default();
  1200. }
  1201. self.content_type.as_mut().unwrap()
  1202. }
  1203. // Take field
  1204. pub fn take_content_type(&mut self) -> ::std::string::String {
  1205. self.content_type.take().unwrap_or_else(|| ::std::string::String::new())
  1206. }
  1207. pub fn get_content_type(&self) -> &str {
  1208. match self.content_type.as_ref() {
  1209. Some(v) => &v,
  1210. None => "",
  1211. }
  1212. }
  1213. fn get_content_type_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> {
  1214. &self.content_type
  1215. }
  1216. fn mut_content_type_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> {
  1217. &mut self.content_type
  1218. }
  1219. // optional string method = 3;
  1220. pub fn clear_method(&mut self) {
  1221. self.method.clear();
  1222. }
  1223. pub fn has_method(&self) -> bool {
  1224. self.method.is_some()
  1225. }
  1226. // Param is passed by value, moved
  1227. pub fn set_method(&mut self, v: ::std::string::String) {
  1228. self.method = ::protobuf::SingularField::some(v);
  1229. }
  1230. // Mutable pointer to the field.
  1231. // If field is not initialized, it is initialized with default value first.
  1232. pub fn mut_method(&mut self) -> &mut ::std::string::String {
  1233. if self.method.is_none() {
  1234. self.method.set_default();
  1235. }
  1236. self.method.as_mut().unwrap()
  1237. }
  1238. // Take field
  1239. pub fn take_method(&mut self) -> ::std::string::String {
  1240. self.method.take().unwrap_or_else(|| ::std::string::String::new())
  1241. }
  1242. pub fn get_method(&self) -> &str {
  1243. match self.method.as_ref() {
  1244. Some(v) => &v,
  1245. None => "",
  1246. }
  1247. }
  1248. fn get_method_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> {
  1249. &self.method
  1250. }
  1251. fn mut_method_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> {
  1252. &mut self.method
  1253. }
  1254. // optional sint32 status_code = 4;
  1255. pub fn clear_status_code(&mut self) {
  1256. self.status_code = ::std::option::Option::None;
  1257. }
  1258. pub fn has_status_code(&self) -> bool {
  1259. self.status_code.is_some()
  1260. }
  1261. // Param is passed by value, moved
  1262. pub fn set_status_code(&mut self, v: i32) {
  1263. self.status_code = ::std::option::Option::Some(v);
  1264. }
  1265. pub fn get_status_code(&self) -> i32 {
  1266. self.status_code.unwrap_or(0)
  1267. }
  1268. fn get_status_code_for_reflect(&self) -> &::std::option::Option<i32> {
  1269. &self.status_code
  1270. }
  1271. fn mut_status_code_for_reflect(&mut self) -> &mut ::std::option::Option<i32> {
  1272. &mut self.status_code
  1273. }
  1274. // repeated .UserField user_fields = 6;
  1275. pub fn clear_user_fields(&mut self) {
  1276. self.user_fields.clear();
  1277. }
  1278. // Param is passed by value, moved
  1279. pub fn set_user_fields(&mut self, v: ::protobuf::RepeatedField<UserField>) {
  1280. self.user_fields = v;
  1281. }
  1282. // Mutable pointer to the field.
  1283. pub fn mut_user_fields(&mut self) -> &mut ::protobuf::RepeatedField<UserField> {
  1284. &mut self.user_fields
  1285. }
  1286. // Take field
  1287. pub fn take_user_fields(&mut self) -> ::protobuf::RepeatedField<UserField> {
  1288. ::std::mem::replace(&mut self.user_fields, ::protobuf::RepeatedField::new())
  1289. }
  1290. pub fn get_user_fields(&self) -> &[UserField] {
  1291. &self.user_fields
  1292. }
  1293. fn get_user_fields_for_reflect(&self) -> &::protobuf::RepeatedField<UserField> {
  1294. &self.user_fields
  1295. }
  1296. fn mut_user_fields_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<UserField> {
  1297. &mut self.user_fields
  1298. }
  1299. }
  1300. impl ::protobuf::Message for Header {
  1301. fn is_initialized(&self) -> bool {
  1302. for v in &self.user_fields {
  1303. if !v.is_initialized() {
  1304. return false;
  1305. }
  1306. };
  1307. true
  1308. }
  1309. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  1310. while !is.eof()? {
  1311. let (field_number, wire_type) = is.read_tag_unpack()?;
  1312. match field_number {
  1313. 1 => {
  1314. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)?;
  1315. },
  1316. 2 => {
  1317. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.content_type)?;
  1318. },
  1319. 3 => {
  1320. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.method)?;
  1321. },
  1322. 4 => {
  1323. if wire_type != ::protobuf::wire_format::WireTypeVarint {
  1324. return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
  1325. }
  1326. let tmp = is.read_sint32()?;
  1327. self.status_code = ::std::option::Option::Some(tmp);
  1328. },
  1329. 6 => {
  1330. ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.user_fields)?;
  1331. },
  1332. _ => {
  1333. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1334. },
  1335. };
  1336. }
  1337. ::std::result::Result::Ok(())
  1338. }
  1339. // Compute sizes of nested messages
  1340. #[allow(unused_variables)]
  1341. fn compute_size(&self) -> u32 {
  1342. let mut my_size = 0;
  1343. if let Some(ref v) = self.uri.as_ref() {
  1344. my_size += ::protobuf::rt::string_size(1, &v);
  1345. }
  1346. if let Some(ref v) = self.content_type.as_ref() {
  1347. my_size += ::protobuf::rt::string_size(2, &v);
  1348. }
  1349. if let Some(ref v) = self.method.as_ref() {
  1350. my_size += ::protobuf::rt::string_size(3, &v);
  1351. }
  1352. if let Some(v) = self.status_code {
  1353. my_size += ::protobuf::rt::value_varint_zigzag_size(4, v);
  1354. }
  1355. for value in &self.user_fields {
  1356. let len = value.compute_size();
  1357. my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
  1358. };
  1359. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1360. self.cached_size.set(my_size);
  1361. my_size
  1362. }
  1363. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  1364. if let Some(ref v) = self.uri.as_ref() {
  1365. os.write_string(1, &v)?;
  1366. }
  1367. if let Some(ref v) = self.content_type.as_ref() {
  1368. os.write_string(2, &v)?;
  1369. }
  1370. if let Some(ref v) = self.method.as_ref() {
  1371. os.write_string(3, &v)?;
  1372. }
  1373. if let Some(v) = self.status_code {
  1374. os.write_sint32(4, v)?;
  1375. }
  1376. for v in &self.user_fields {
  1377. os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?;
  1378. os.write_raw_varint32(v.get_cached_size())?;
  1379. v.write_to_with_cached_sizes(os)?;
  1380. };
  1381. os.write_unknown_fields(self.get_unknown_fields())?;
  1382. ::std::result::Result::Ok(())
  1383. }
  1384. fn get_cached_size(&self) -> u32 {
  1385. self.cached_size.get()
  1386. }
  1387. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1388. &self.unknown_fields
  1389. }
  1390. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1391. &mut self.unknown_fields
  1392. }
  1393. fn as_any(&self) -> &::std::any::Any {
  1394. self as &::std::any::Any
  1395. }
  1396. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  1397. self as &mut ::std::any::Any
  1398. }
  1399. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  1400. self
  1401. }
  1402. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1403. ::protobuf::MessageStatic::descriptor_static(None::<Self>)
  1404. }
  1405. }
  1406. impl ::protobuf::MessageStatic for Header {
  1407. fn new() -> Header {
  1408. Header::new()
  1409. }
  1410. fn descriptor_static(_: ::std::option::Option<Header>) -> &'static ::protobuf::reflect::MessageDescriptor {
  1411. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  1412. lock: ::protobuf::lazy::ONCE_INIT,
  1413. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  1414. };
  1415. unsafe {
  1416. descriptor.get(|| {
  1417. let mut fields = ::std::vec::Vec::new();
  1418. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1419. "uri",
  1420. Header::get_uri_for_reflect,
  1421. Header::mut_uri_for_reflect,
  1422. ));
  1423. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1424. "content_type",
  1425. Header::get_content_type_for_reflect,
  1426. Header::mut_content_type_for_reflect,
  1427. ));
  1428. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1429. "method",
  1430. Header::get_method_for_reflect,
  1431. Header::mut_method_for_reflect,
  1432. ));
  1433. fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>(
  1434. "status_code",
  1435. Header::get_status_code_for_reflect,
  1436. Header::mut_status_code_for_reflect,
  1437. ));
  1438. fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<UserField>>(
  1439. "user_fields",
  1440. Header::get_user_fields_for_reflect,
  1441. Header::mut_user_fields_for_reflect,
  1442. ));
  1443. ::protobuf::reflect::MessageDescriptor::new::<Header>(
  1444. "Header",
  1445. fields,
  1446. file_descriptor_proto()
  1447. )
  1448. })
  1449. }
  1450. }
  1451. }
  1452. impl ::protobuf::Clear for Header {
  1453. fn clear(&mut self) {
  1454. self.clear_uri();
  1455. self.clear_content_type();
  1456. self.clear_method();
  1457. self.clear_status_code();
  1458. self.clear_user_fields();
  1459. self.unknown_fields.clear();
  1460. }
  1461. }
  1462. impl ::std::fmt::Debug for Header {
  1463. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  1464. ::protobuf::text_format::fmt(self, f)
  1465. }
  1466. }
  1467. impl ::protobuf::reflect::ProtobufValue for Header {
  1468. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  1469. ::protobuf::reflect::ProtobufValueRef::Message(self)
  1470. }
  1471. }
  1472. #[derive(PartialEq,Clone,Default)]
  1473. pub struct UserField {
  1474. // message fields
  1475. key: ::protobuf::SingularField<::std::string::String>,
  1476. value: ::protobuf::SingularField<::std::vec::Vec<u8>>,
  1477. // special fields
  1478. unknown_fields: ::protobuf::UnknownFields,
  1479. cached_size: ::protobuf::CachedSize,
  1480. }
  1481. // see codegen.rs for the explanation why impl Sync explicitly
  1482. unsafe impl ::std::marker::Sync for UserField {}
  1483. impl UserField {
  1484. pub fn new() -> UserField {
  1485. ::std::default::Default::default()
  1486. }
  1487. pub fn default_instance() -> &'static UserField {
  1488. static mut instance: ::protobuf::lazy::Lazy<UserField> = ::protobuf::lazy::Lazy {
  1489. lock: ::protobuf::lazy::ONCE_INIT,
  1490. ptr: 0 as *const UserField,
  1491. };
  1492. unsafe {
  1493. instance.get(UserField::new)
  1494. }
  1495. }
  1496. // optional string key = 1;
  1497. pub fn clear_key(&mut self) {
  1498. self.key.clear();
  1499. }
  1500. pub fn has_key(&self) -> bool {
  1501. self.key.is_some()
  1502. }
  1503. // Param is passed by value, moved
  1504. pub fn set_key(&mut self, v: ::std::string::String) {
  1505. self.key = ::protobuf::SingularField::some(v);
  1506. }
  1507. // Mutable pointer to the field.
  1508. // If field is not initialized, it is initialized with default value first.
  1509. pub fn mut_key(&mut self) -> &mut ::std::string::String {
  1510. if self.key.is_none() {
  1511. self.key.set_default();
  1512. }
  1513. self.key.as_mut().unwrap()
  1514. }
  1515. // Take field
  1516. pub fn take_key(&mut self) -> ::std::string::String {
  1517. self.key.take().unwrap_or_else(|| ::std::string::String::new())
  1518. }
  1519. pub fn get_key(&self) -> &str {
  1520. match self.key.as_ref() {
  1521. Some(v) => &v,
  1522. None => "",
  1523. }
  1524. }
  1525. fn get_key_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> {
  1526. &self.key
  1527. }
  1528. fn mut_key_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> {
  1529. &mut self.key
  1530. }
  1531. // optional bytes value = 2;
  1532. pub fn clear_value(&mut self) {
  1533. self.value.clear();
  1534. }
  1535. pub fn has_value(&self) -> bool {
  1536. self.value.is_some()
  1537. }
  1538. // Param is passed by value, moved
  1539. pub fn set_value(&mut self, v: ::std::vec::Vec<u8>) {
  1540. self.value = ::protobuf::SingularField::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_value(&mut self) -> &mut ::std::vec::Vec<u8> {
  1545. if self.value.is_none() {
  1546. self.value.set_default();
  1547. }
  1548. self.value.as_mut().unwrap()
  1549. }
  1550. // Take field
  1551. pub fn take_value(&mut self) -> ::std::vec::Vec<u8> {
  1552. self.value.take().unwrap_or_else(|| ::std::vec::Vec::new())
  1553. }
  1554. pub fn get_value(&self) -> &[u8] {
  1555. match self.value.as_ref() {
  1556. Some(v) => &v,
  1557. None => &[],
  1558. }
  1559. }
  1560. fn get_value_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec<u8>> {
  1561. &self.value
  1562. }
  1563. fn mut_value_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec<u8>> {
  1564. &mut self.value
  1565. }
  1566. }
  1567. impl ::protobuf::Message for UserField {
  1568. fn is_initialized(&self) -> bool {
  1569. true
  1570. }
  1571. fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
  1572. while !is.eof()? {
  1573. let (field_number, wire_type) = is.read_tag_unpack()?;
  1574. match field_number {
  1575. 1 => {
  1576. ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.key)?;
  1577. },
  1578. 2 => {
  1579. ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.value)?;
  1580. },
  1581. _ => {
  1582. ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
  1583. },
  1584. };
  1585. }
  1586. ::std::result::Result::Ok(())
  1587. }
  1588. // Compute sizes of nested messages
  1589. #[allow(unused_variables)]
  1590. fn compute_size(&self) -> u32 {
  1591. let mut my_size = 0;
  1592. if let Some(ref v) = self.key.as_ref() {
  1593. my_size += ::protobuf::rt::string_size(1, &v);
  1594. }
  1595. if let Some(ref v) = self.value.as_ref() {
  1596. my_size += ::protobuf::rt::bytes_size(2, &v);
  1597. }
  1598. my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
  1599. self.cached_size.set(my_size);
  1600. my_size
  1601. }
  1602. fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
  1603. if let Some(ref v) = self.key.as_ref() {
  1604. os.write_string(1, &v)?;
  1605. }
  1606. if let Some(ref v) = self.value.as_ref() {
  1607. os.write_bytes(2, &v)?;
  1608. }
  1609. os.write_unknown_fields(self.get_unknown_fields())?;
  1610. ::std::result::Result::Ok(())
  1611. }
  1612. fn get_cached_size(&self) -> u32 {
  1613. self.cached_size.get()
  1614. }
  1615. fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
  1616. &self.unknown_fields
  1617. }
  1618. fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
  1619. &mut self.unknown_fields
  1620. }
  1621. fn as_any(&self) -> &::std::any::Any {
  1622. self as &::std::any::Any
  1623. }
  1624. fn as_any_mut(&mut self) -> &mut ::std::any::Any {
  1625. self as &mut ::std::any::Any
  1626. }
  1627. fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
  1628. self
  1629. }
  1630. fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
  1631. ::protobuf::MessageStatic::descriptor_static(None::<Self>)
  1632. }
  1633. }
  1634. impl ::protobuf::MessageStatic for UserField {
  1635. fn new() -> UserField {
  1636. UserField::new()
  1637. }
  1638. fn descriptor_static(_: ::std::option::Option<UserField>) -> &'static ::protobuf::reflect::MessageDescriptor {
  1639. static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
  1640. lock: ::protobuf::lazy::ONCE_INIT,
  1641. ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
  1642. };
  1643. unsafe {
  1644. descriptor.get(|| {
  1645. let mut fields = ::std::vec::Vec::new();
  1646. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
  1647. "key",
  1648. UserField::get_key_for_reflect,
  1649. UserField::mut_key_for_reflect,
  1650. ));
  1651. fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
  1652. "value",
  1653. UserField::get_value_for_reflect,
  1654. UserField::mut_value_for_reflect,
  1655. ));
  1656. ::protobuf::reflect::MessageDescriptor::new::<UserField>(
  1657. "UserField",
  1658. fields,
  1659. file_descriptor_proto()
  1660. )
  1661. })
  1662. }
  1663. }
  1664. }
  1665. impl ::protobuf::Clear for UserField {
  1666. fn clear(&mut self) {
  1667. self.clear_key();
  1668. self.clear_value();
  1669. self.unknown_fields.clear();
  1670. }
  1671. }
  1672. impl ::std::fmt::Debug for UserField {
  1673. fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  1674. ::protobuf::text_format::fmt(self, f)
  1675. }
  1676. }
  1677. impl ::protobuf::reflect::ProtobufValue for UserField {
  1678. fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
  1679. ::protobuf::reflect::ProtobufValueRef::Message(self)
  1680. }
  1681. }
  1682. static file_descriptor_proto_data: &'static [u8] = b"\
  1683. \n\rmercury.proto\"C\n\x16MercuryMultiGetRequest\x12)\n\x07request\x18\
  1684. \x01\x20\x03(\x0b2\x0f.MercuryRequestR\x07request\";\n\x14MercuryMultiGe\
  1685. tReply\x12#\n\x05reply\x18\x01\x20\x03(\x0b2\r.MercuryReplyR\x05reply\"m\
  1686. \n\x0eMercuryRequest\x12\x10\n\x03uri\x18\x01\x20\x01(\tR\x03uri\x12!\n\
  1687. \x0ccontent_type\x18\x02\x20\x01(\tR\x0bcontentType\x12\x12\n\x04body\
  1688. \x18\x03\x20\x01(\x0cR\x04body\x12\x12\n\x04etag\x18\x04\x20\x01(\x0cR\
  1689. \x04etag\"\xb3\x02\n\x0cMercuryReply\x12\x1f\n\x0bstatus_code\x18\x01\
  1690. \x20\x01(\x11R\nstatusCode\x12%\n\x0estatus_message\x18\x02\x20\x01(\tR\
  1691. \rstatusMessage\x12<\n\x0ccache_policy\x18\x03\x20\x01(\x0e2\x19.Mercury\
  1692. Reply.CachePolicyR\x0bcachePolicy\x12\x10\n\x03ttl\x18\x04\x20\x01(\x11R\
  1693. \x03ttl\x12\x12\n\x04etag\x18\x05\x20\x01(\x0cR\x04etag\x12!\n\x0cconten\
  1694. t_type\x18\x06\x20\x01(\tR\x0bcontentType\x12\x12\n\x04body\x18\x07\x20\
  1695. \x01(\x0cR\x04body\"@\n\x0bCachePolicy\x12\x0c\n\x08CACHE_NO\x10\x01\x12\
  1696. \x11\n\rCACHE_PRIVATE\x10\x02\x12\x10\n\x0cCACHE_PUBLIC\x10\x03\"\xa3\
  1697. \x01\n\x06Header\x12\x10\n\x03uri\x18\x01\x20\x01(\tR\x03uri\x12!\n\x0cc\
  1698. ontent_type\x18\x02\x20\x01(\tR\x0bcontentType\x12\x16\n\x06method\x18\
  1699. \x03\x20\x01(\tR\x06method\x12\x1f\n\x0bstatus_code\x18\x04\x20\x01(\x11\
  1700. R\nstatusCode\x12+\n\x0buser_fields\x18\x06\x20\x03(\x0b2\n.UserFieldR\n\
  1701. userFields\"3\n\tUserField\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\
  1702. \x12\x14\n\x05value\x18\x02\x20\x01(\x0cR\x05valueJ\xaf\r\n\x06\x12\x04\
  1703. \0\0,\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\
  1704. \x04\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x1e\n\x0b\n\x04\x04\0\x02\0\
  1705. \x12\x03\x03\x04*\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\x03\x04\x0c\n\x0c\
  1706. \n\x05\x04\0\x02\0\x06\x12\x03\x03\r\x1b\n\x0c\n\x05\x04\0\x02\0\x01\x12\
  1707. \x03\x03\x1c#\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03&)\n\n\n\x02\x04\
  1708. \x01\x12\x04\x06\0\x08\x01\n\n\n\x03\x04\x01\x01\x12\x03\x06\x08\x1c\n\
  1709. \x0b\n\x04\x04\x01\x02\0\x12\x03\x07\x04&\n\x0c\n\x05\x04\x01\x02\0\x04\
  1710. \x12\x03\x07\x04\x0c\n\x0c\n\x05\x04\x01\x02\0\x06\x12\x03\x07\r\x19\n\
  1711. \x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x07\x1a\x1f\n\x0c\n\x05\x04\x01\x02\
  1712. \0\x03\x12\x03\x07\"%\n\n\n\x02\x04\x02\x12\x04\n\0\x0f\x01\n\n\n\x03\
  1713. \x04\x02\x01\x12\x03\n\x08\x16\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x0b\x04\
  1714. \x1e\n\x0c\n\x05\x04\x02\x02\0\x04\x12\x03\x0b\x04\x0c\n\x0c\n\x05\x04\
  1715. \x02\x02\0\x05\x12\x03\x0b\r\x13\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\
  1716. \x0b\x14\x17\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x0b\x1a\x1d\n\x0b\n\
  1717. \x04\x04\x02\x02\x01\x12\x03\x0c\x04'\n\x0c\n\x05\x04\x02\x02\x01\x04\
  1718. \x12\x03\x0c\x04\x0c\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\x0c\r\x13\n\
  1719. \x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\x0c\x14\x20\n\x0c\n\x05\x04\x02\
  1720. \x02\x01\x03\x12\x03\x0c#&\n\x0b\n\x04\x04\x02\x02\x02\x12\x03\r\x04\x1e\
  1721. \n\x0c\n\x05\x04\x02\x02\x02\x04\x12\x03\r\x04\x0c\n\x0c\n\x05\x04\x02\
  1722. \x02\x02\x05\x12\x03\r\r\x12\n\x0c\n\x05\x04\x02\x02\x02\x01\x12\x03\r\
  1723. \x13\x17\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\x03\r\x1a\x1d\n\x0b\n\x04\
  1724. \x04\x02\x02\x03\x12\x03\x0e\x04\x1e\n\x0c\n\x05\x04\x02\x02\x03\x04\x12\
  1725. \x03\x0e\x04\x0c\n\x0c\n\x05\x04\x02\x02\x03\x05\x12\x03\x0e\r\x12\n\x0c\
  1726. \n\x05\x04\x02\x02\x03\x01\x12\x03\x0e\x13\x17\n\x0c\n\x05\x04\x02\x02\
  1727. \x03\x03\x12\x03\x0e\x1a\x1d\n\n\n\x02\x04\x03\x12\x04\x11\0\x1e\x01\n\n\
  1728. \n\x03\x04\x03\x01\x12\x03\x11\x08\x14\n\x0b\n\x04\x04\x03\x02\0\x12\x03\
  1729. \x12\x04&\n\x0c\n\x05\x04\x03\x02\0\x04\x12\x03\x12\x04\x0c\n\x0c\n\x05\
  1730. \x04\x03\x02\0\x05\x12\x03\x12\r\x13\n\x0c\n\x05\x04\x03\x02\0\x01\x12\
  1731. \x03\x12\x14\x1f\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03\x12\"%\n\x0b\n\
  1732. \x04\x04\x03\x02\x01\x12\x03\x13\x04)\n\x0c\n\x05\x04\x03\x02\x01\x04\
  1733. \x12\x03\x13\x04\x0c\n\x0c\n\x05\x04\x03\x02\x01\x05\x12\x03\x13\r\x13\n\
  1734. \x0c\n\x05\x04\x03\x02\x01\x01\x12\x03\x13\x14\"\n\x0c\n\x05\x04\x03\x02\
  1735. \x01\x03\x12\x03\x13%(\n\x0b\n\x04\x04\x03\x02\x02\x12\x03\x14\x04,\n\
  1736. \x0c\n\x05\x04\x03\x02\x02\x04\x12\x03\x14\x04\x0c\n\x0c\n\x05\x04\x03\
  1737. \x02\x02\x06\x12\x03\x14\r\x18\n\x0c\n\x05\x04\x03\x02\x02\x01\x12\x03\
  1738. \x14\x19%\n\x0c\n\x05\x04\x03\x02\x02\x03\x12\x03\x14(+\n\x0c\n\x04\x04\
  1739. \x03\x04\0\x12\x04\x15\x04\x19\x05\n\x0c\n\x05\x04\x03\x04\0\x01\x12\x03\
  1740. \x15\t\x14\n\r\n\x06\x04\x03\x04\0\x02\0\x12\x03\x16\x08\x17\n\x0e\n\x07\
  1741. \x04\x03\x04\0\x02\0\x01\x12\x03\x16\x08\x10\n\x0e\n\x07\x04\x03\x04\0\
  1742. \x02\0\x02\x12\x03\x16\x13\x16\n\r\n\x06\x04\x03\x04\0\x02\x01\x12\x03\
  1743. \x17\x08\x1c\n\x0e\n\x07\x04\x03\x04\0\x02\x01\x01\x12\x03\x17\x08\x15\n\
  1744. \x0e\n\x07\x04\x03\x04\0\x02\x01\x02\x12\x03\x17\x18\x1b\n\r\n\x06\x04\
  1745. \x03\x04\0\x02\x02\x12\x03\x18\x08\x1b\n\x0e\n\x07\x04\x03\x04\0\x02\x02\
  1746. \x01\x12\x03\x18\x08\x14\n\x0e\n\x07\x04\x03\x04\0\x02\x02\x02\x12\x03\
  1747. \x18\x17\x1a\n\x0b\n\x04\x04\x03\x02\x03\x12\x03\x1a\x04\x1e\n\x0c\n\x05\
  1748. \x04\x03\x02\x03\x04\x12\x03\x1a\x04\x0c\n\x0c\n\x05\x04\x03\x02\x03\x05\
  1749. \x12\x03\x1a\r\x13\n\x0c\n\x05\x04\x03\x02\x03\x01\x12\x03\x1a\x14\x17\n\
  1750. \x0c\n\x05\x04\x03\x02\x03\x03\x12\x03\x1a\x1a\x1d\n\x0b\n\x04\x04\x03\
  1751. \x02\x04\x12\x03\x1b\x04\x1e\n\x0c\n\x05\x04\x03\x02\x04\x04\x12\x03\x1b\
  1752. \x04\x0c\n\x0c\n\x05\x04\x03\x02\x04\x05\x12\x03\x1b\r\x12\n\x0c\n\x05\
  1753. \x04\x03\x02\x04\x01\x12\x03\x1b\x13\x17\n\x0c\n\x05\x04\x03\x02\x04\x03\
  1754. \x12\x03\x1b\x1a\x1d\n\x0b\n\x04\x04\x03\x02\x05\x12\x03\x1c\x04'\n\x0c\
  1755. \n\x05\x04\x03\x02\x05\x04\x12\x03\x1c\x04\x0c\n\x0c\n\x05\x04\x03\x02\
  1756. \x05\x05\x12\x03\x1c\r\x13\n\x0c\n\x05\x04\x03\x02\x05\x01\x12\x03\x1c\
  1757. \x14\x20\n\x0c\n\x05\x04\x03\x02\x05\x03\x12\x03\x1c#&\n\x0b\n\x04\x04\
  1758. \x03\x02\x06\x12\x03\x1d\x04\x1e\n\x0c\n\x05\x04\x03\x02\x06\x04\x12\x03\
  1759. \x1d\x04\x0c\n\x0c\n\x05\x04\x03\x02\x06\x05\x12\x03\x1d\r\x12\n\x0c\n\
  1760. \x05\x04\x03\x02\x06\x01\x12\x03\x1d\x13\x17\n\x0c\n\x05\x04\x03\x02\x06\
  1761. \x03\x12\x03\x1d\x1a\x1d\n\n\n\x02\x04\x04\x12\x04!\0'\x01\n\n\n\x03\x04\
  1762. \x04\x01\x12\x03!\x08\x0e\n\x0b\n\x04\x04\x04\x02\0\x12\x03\"\x04\x1f\n\
  1763. \x0c\n\x05\x04\x04\x02\0\x04\x12\x03\"\x04\x0c\n\x0c\n\x05\x04\x04\x02\0\
  1764. \x05\x12\x03\"\r\x13\n\x0c\n\x05\x04\x04\x02\0\x01\x12\x03\"\x14\x17\n\
  1765. \x0c\n\x05\x04\x04\x02\0\x03\x12\x03\"\x1a\x1e\n\x0b\n\x04\x04\x04\x02\
  1766. \x01\x12\x03#\x04(\n\x0c\n\x05\x04\x04\x02\x01\x04\x12\x03#\x04\x0c\n\
  1767. \x0c\n\x05\x04\x04\x02\x01\x05\x12\x03#\r\x13\n\x0c\n\x05\x04\x04\x02\
  1768. \x01\x01\x12\x03#\x14\x20\n\x0c\n\x05\x04\x04\x02\x01\x03\x12\x03##'\n\
  1769. \x0b\n\x04\x04\x04\x02\x02\x12\x03$\x04\"\n\x0c\n\x05\x04\x04\x02\x02\
  1770. \x04\x12\x03$\x04\x0c\n\x0c\n\x05\x04\x04\x02\x02\x05\x12\x03$\r\x13\n\
  1771. \x0c\n\x05\x04\x04\x02\x02\x01\x12\x03$\x14\x1a\n\x0c\n\x05\x04\x04\x02\
  1772. \x02\x03\x12\x03$\x1d!\n\x0b\n\x04\x04\x04\x02\x03\x12\x03%\x04'\n\x0c\n\
  1773. \x05\x04\x04\x02\x03\x04\x12\x03%\x04\x0c\n\x0c\n\x05\x04\x04\x02\x03\
  1774. \x05\x12\x03%\r\x13\n\x0c\n\x05\x04\x04\x02\x03\x01\x12\x03%\x14\x1f\n\
  1775. \x0c\n\x05\x04\x04\x02\x03\x03\x12\x03%\"&\n\x0b\n\x04\x04\x04\x02\x04\
  1776. \x12\x03&\x04*\n\x0c\n\x05\x04\x04\x02\x04\x04\x12\x03&\x04\x0c\n\x0c\n\
  1777. \x05\x04\x04\x02\x04\x06\x12\x03&\r\x16\n\x0c\n\x05\x04\x04\x02\x04\x01\
  1778. \x12\x03&\x17\"\n\x0c\n\x05\x04\x04\x02\x04\x03\x12\x03&%)\n\n\n\x02\x04\
  1779. \x05\x12\x04)\0,\x01\n\n\n\x03\x04\x05\x01\x12\x03)\x08\x11\n\x0b\n\x04\
  1780. \x04\x05\x02\0\x12\x03*\x04\x1f\n\x0c\n\x05\x04\x05\x02\0\x04\x12\x03*\
  1781. \x04\x0c\n\x0c\n\x05\x04\x05\x02\0\x05\x12\x03*\r\x13\n\x0c\n\x05\x04\
  1782. \x05\x02\0\x01\x12\x03*\x14\x17\n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03*\
  1783. \x1a\x1e\n\x0b\n\x04\x04\x05\x02\x01\x12\x03+\x04\x20\n\x0c\n\x05\x04\
  1784. \x05\x02\x01\x04\x12\x03+\x04\x0c\n\x0c\n\x05\x04\x05\x02\x01\x05\x12\
  1785. \x03+\r\x12\n\x0c\n\x05\x04\x05\x02\x01\x01\x12\x03+\x13\x18\n\x0c\n\x05\
  1786. \x04\x05\x02\x01\x03\x12\x03+\x1b\x1f\
  1787. ";
  1788. static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
  1789. lock: ::protobuf::lazy::ONCE_INIT,
  1790. ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
  1791. };
  1792. fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
  1793. ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
  1794. }
  1795. pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
  1796. unsafe {
  1797. file_descriptor_proto_lazy.get(|| {
  1798. parse_descriptor_proto()
  1799. })
  1800. }
  1801. }