1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861 |
- // This file is generated by rust-protobuf 2.8.1. Do not edit
- // @generated
- // https://github.com/Manishearth/rust-clippy/issues/702
- #![allow(unknown_lints)]
- #![allow(clippy::all)]
- #![cfg_attr(rustfmt, rustfmt_skip)]
- #![allow(box_pointers)]
- #![allow(dead_code)]
- #![allow(missing_docs)]
- #![allow(non_camel_case_types)]
- #![allow(non_snake_case)]
- #![allow(non_upper_case_globals)]
- #![allow(trivial_casts)]
- #![allow(unsafe_code)]
- #![allow(unused_imports)]
- #![allow(unused_results)]
- //! Generated file from `mercury.proto`
- use protobuf::Message as Message_imported_for_functions;
- use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
- /// Generated files are compatible only with the same version
- /// of protobuf runtime.
- const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_1;
- #[derive(PartialEq,Clone,Default)]
- pub struct MercuryMultiGetRequest {
- // message fields
- request: ::protobuf::RepeatedField<MercuryRequest>,
- // special fields
- pub unknown_fields: ::protobuf::UnknownFields,
- pub cached_size: ::protobuf::CachedSize,
- }
- impl<'a> ::std::default::Default for &'a MercuryMultiGetRequest {
- fn default() -> &'a MercuryMultiGetRequest {
- <MercuryMultiGetRequest as ::protobuf::Message>::default_instance()
- }
- }
- impl MercuryMultiGetRequest {
- pub fn new() -> MercuryMultiGetRequest {
- ::std::default::Default::default()
- }
- // repeated .MercuryRequest request = 1;
- pub fn get_request(&self) -> &[MercuryRequest] {
- &self.request
- }
- pub fn clear_request(&mut self) {
- self.request.clear();
- }
- // Param is passed by value, moved
- pub fn set_request(&mut self, v: ::protobuf::RepeatedField<MercuryRequest>) {
- self.request = v;
- }
- // Mutable pointer to the field.
- pub fn mut_request(&mut self) -> &mut ::protobuf::RepeatedField<MercuryRequest> {
- &mut self.request
- }
- // Take field
- pub fn take_request(&mut self) -> ::protobuf::RepeatedField<MercuryRequest> {
- ::std::mem::replace(&mut self.request, ::protobuf::RepeatedField::new())
- }
- }
- impl ::protobuf::Message for MercuryMultiGetRequest {
- fn is_initialized(&self) -> bool {
- for v in &self.request {
- if !v.is_initialized() {
- return false;
- }
- };
- true
- }
- fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
- while !is.eof()? {
- let (field_number, wire_type) = is.read_tag_unpack()?;
- match field_number {
- 1 => {
- ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.request)?;
- },
- _ => {
- ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
- },
- };
- }
- ::std::result::Result::Ok(())
- }
- // Compute sizes of nested messages
- #[allow(unused_variables)]
- fn compute_size(&self) -> u32 {
- let mut my_size = 0;
- for value in &self.request {
- let len = value.compute_size();
- my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
- };
- my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
- self.cached_size.set(my_size);
- my_size
- }
- fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
- for v in &self.request {
- os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
- os.write_raw_varint32(v.get_cached_size())?;
- v.write_to_with_cached_sizes(os)?;
- };
- os.write_unknown_fields(self.get_unknown_fields())?;
- ::std::result::Result::Ok(())
- }
- fn get_cached_size(&self) -> u32 {
- self.cached_size.get()
- }
- fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
- &self.unknown_fields
- }
- fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
- &mut self.unknown_fields
- }
- fn as_any(&self) -> &dyn (::std::any::Any) {
- self as &dyn (::std::any::Any)
- }
- fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
- self as &mut dyn (::std::any::Any)
- }
- fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
- self
- }
- fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
- Self::descriptor_static()
- }
- fn new() -> MercuryMultiGetRequest {
- MercuryMultiGetRequest::new()
- }
- fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
- static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
- };
- unsafe {
- descriptor.get(|| {
- let mut fields = ::std::vec::Vec::new();
- fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<MercuryRequest>>(
- "request",
- |m: &MercuryMultiGetRequest| { &m.request },
- |m: &mut MercuryMultiGetRequest| { &mut m.request },
- ));
- ::protobuf::reflect::MessageDescriptor::new::<MercuryMultiGetRequest>(
- "MercuryMultiGetRequest",
- fields,
- file_descriptor_proto()
- )
- })
- }
- }
- fn default_instance() -> &'static MercuryMultiGetRequest {
- static mut instance: ::protobuf::lazy::Lazy<MercuryMultiGetRequest> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const MercuryMultiGetRequest,
- };
- unsafe {
- instance.get(MercuryMultiGetRequest::new)
- }
- }
- }
- impl ::protobuf::Clear for MercuryMultiGetRequest {
- fn clear(&mut self) {
- self.request.clear();
- self.unknown_fields.clear();
- }
- }
- impl ::std::fmt::Debug for MercuryMultiGetRequest {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- ::protobuf::text_format::fmt(self, f)
- }
- }
- impl ::protobuf::reflect::ProtobufValue for MercuryMultiGetRequest {
- fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
- ::protobuf::reflect::ProtobufValueRef::Message(self)
- }
- }
- #[derive(PartialEq,Clone,Default)]
- pub struct MercuryMultiGetReply {
- // message fields
- reply: ::protobuf::RepeatedField<MercuryReply>,
- // special fields
- pub unknown_fields: ::protobuf::UnknownFields,
- pub cached_size: ::protobuf::CachedSize,
- }
- impl<'a> ::std::default::Default for &'a MercuryMultiGetReply {
- fn default() -> &'a MercuryMultiGetReply {
- <MercuryMultiGetReply as ::protobuf::Message>::default_instance()
- }
- }
- impl MercuryMultiGetReply {
- pub fn new() -> MercuryMultiGetReply {
- ::std::default::Default::default()
- }
- // repeated .MercuryReply reply = 1;
- pub fn get_reply(&self) -> &[MercuryReply] {
- &self.reply
- }
- pub fn clear_reply(&mut self) {
- self.reply.clear();
- }
- // Param is passed by value, moved
- pub fn set_reply(&mut self, v: ::protobuf::RepeatedField<MercuryReply>) {
- self.reply = v;
- }
- // Mutable pointer to the field.
- pub fn mut_reply(&mut self) -> &mut ::protobuf::RepeatedField<MercuryReply> {
- &mut self.reply
- }
- // Take field
- pub fn take_reply(&mut self) -> ::protobuf::RepeatedField<MercuryReply> {
- ::std::mem::replace(&mut self.reply, ::protobuf::RepeatedField::new())
- }
- }
- impl ::protobuf::Message for MercuryMultiGetReply {
- fn is_initialized(&self) -> bool {
- for v in &self.reply {
- if !v.is_initialized() {
- return false;
- }
- };
- true
- }
- fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
- while !is.eof()? {
- let (field_number, wire_type) = is.read_tag_unpack()?;
- match field_number {
- 1 => {
- ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.reply)?;
- },
- _ => {
- ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
- },
- };
- }
- ::std::result::Result::Ok(())
- }
- // Compute sizes of nested messages
- #[allow(unused_variables)]
- fn compute_size(&self) -> u32 {
- let mut my_size = 0;
- for value in &self.reply {
- let len = value.compute_size();
- my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
- };
- my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
- self.cached_size.set(my_size);
- my_size
- }
- fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
- for v in &self.reply {
- os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
- os.write_raw_varint32(v.get_cached_size())?;
- v.write_to_with_cached_sizes(os)?;
- };
- os.write_unknown_fields(self.get_unknown_fields())?;
- ::std::result::Result::Ok(())
- }
- fn get_cached_size(&self) -> u32 {
- self.cached_size.get()
- }
- fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
- &self.unknown_fields
- }
- fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
- &mut self.unknown_fields
- }
- fn as_any(&self) -> &dyn (::std::any::Any) {
- self as &dyn (::std::any::Any)
- }
- fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
- self as &mut dyn (::std::any::Any)
- }
- fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
- self
- }
- fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
- Self::descriptor_static()
- }
- fn new() -> MercuryMultiGetReply {
- MercuryMultiGetReply::new()
- }
- fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
- static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
- };
- unsafe {
- descriptor.get(|| {
- let mut fields = ::std::vec::Vec::new();
- fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<MercuryReply>>(
- "reply",
- |m: &MercuryMultiGetReply| { &m.reply },
- |m: &mut MercuryMultiGetReply| { &mut m.reply },
- ));
- ::protobuf::reflect::MessageDescriptor::new::<MercuryMultiGetReply>(
- "MercuryMultiGetReply",
- fields,
- file_descriptor_proto()
- )
- })
- }
- }
- fn default_instance() -> &'static MercuryMultiGetReply {
- static mut instance: ::protobuf::lazy::Lazy<MercuryMultiGetReply> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const MercuryMultiGetReply,
- };
- unsafe {
- instance.get(MercuryMultiGetReply::new)
- }
- }
- }
- impl ::protobuf::Clear for MercuryMultiGetReply {
- fn clear(&mut self) {
- self.reply.clear();
- self.unknown_fields.clear();
- }
- }
- impl ::std::fmt::Debug for MercuryMultiGetReply {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- ::protobuf::text_format::fmt(self, f)
- }
- }
- impl ::protobuf::reflect::ProtobufValue for MercuryMultiGetReply {
- fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
- ::protobuf::reflect::ProtobufValueRef::Message(self)
- }
- }
- #[derive(PartialEq,Clone,Default)]
- pub struct MercuryRequest {
- // message fields
- uri: ::protobuf::SingularField<::std::string::String>,
- content_type: ::protobuf::SingularField<::std::string::String>,
- body: ::protobuf::SingularField<::std::vec::Vec<u8>>,
- etag: ::protobuf::SingularField<::std::vec::Vec<u8>>,
- // special fields
- pub unknown_fields: ::protobuf::UnknownFields,
- pub cached_size: ::protobuf::CachedSize,
- }
- impl<'a> ::std::default::Default for &'a MercuryRequest {
- fn default() -> &'a MercuryRequest {
- <MercuryRequest as ::protobuf::Message>::default_instance()
- }
- }
- impl MercuryRequest {
- pub fn new() -> MercuryRequest {
- ::std::default::Default::default()
- }
- // optional string uri = 1;
- pub fn get_uri(&self) -> &str {
- match self.uri.as_ref() {
- Some(v) => &v,
- None => "",
- }
- }
- pub fn clear_uri(&mut self) {
- self.uri.clear();
- }
- pub fn has_uri(&self) -> bool {
- self.uri.is_some()
- }
- // Param is passed by value, moved
- pub fn set_uri(&mut self, v: ::std::string::String) {
- self.uri = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_uri(&mut self) -> &mut ::std::string::String {
- if self.uri.is_none() {
- self.uri.set_default();
- }
- self.uri.as_mut().unwrap()
- }
- // Take field
- pub fn take_uri(&mut self) -> ::std::string::String {
- self.uri.take().unwrap_or_else(|| ::std::string::String::new())
- }
- // optional string content_type = 2;
- pub fn get_content_type(&self) -> &str {
- match self.content_type.as_ref() {
- Some(v) => &v,
- None => "",
- }
- }
- pub fn clear_content_type(&mut self) {
- self.content_type.clear();
- }
- pub fn has_content_type(&self) -> bool {
- self.content_type.is_some()
- }
- // Param is passed by value, moved
- pub fn set_content_type(&mut self, v: ::std::string::String) {
- self.content_type = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_content_type(&mut self) -> &mut ::std::string::String {
- if self.content_type.is_none() {
- self.content_type.set_default();
- }
- self.content_type.as_mut().unwrap()
- }
- // Take field
- pub fn take_content_type(&mut self) -> ::std::string::String {
- self.content_type.take().unwrap_or_else(|| ::std::string::String::new())
- }
- // optional bytes body = 3;
- pub fn get_body(&self) -> &[u8] {
- match self.body.as_ref() {
- Some(v) => &v,
- None => &[],
- }
- }
- pub fn clear_body(&mut self) {
- self.body.clear();
- }
- pub fn has_body(&self) -> bool {
- self.body.is_some()
- }
- // Param is passed by value, moved
- pub fn set_body(&mut self, v: ::std::vec::Vec<u8>) {
- self.body = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_body(&mut self) -> &mut ::std::vec::Vec<u8> {
- if self.body.is_none() {
- self.body.set_default();
- }
- self.body.as_mut().unwrap()
- }
- // Take field
- pub fn take_body(&mut self) -> ::std::vec::Vec<u8> {
- self.body.take().unwrap_or_else(|| ::std::vec::Vec::new())
- }
- // optional bytes etag = 4;
- pub fn get_etag(&self) -> &[u8] {
- match self.etag.as_ref() {
- Some(v) => &v,
- None => &[],
- }
- }
- pub fn clear_etag(&mut self) {
- self.etag.clear();
- }
- pub fn has_etag(&self) -> bool {
- self.etag.is_some()
- }
- // Param is passed by value, moved
- pub fn set_etag(&mut self, v: ::std::vec::Vec<u8>) {
- self.etag = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_etag(&mut self) -> &mut ::std::vec::Vec<u8> {
- if self.etag.is_none() {
- self.etag.set_default();
- }
- self.etag.as_mut().unwrap()
- }
- // Take field
- pub fn take_etag(&mut self) -> ::std::vec::Vec<u8> {
- self.etag.take().unwrap_or_else(|| ::std::vec::Vec::new())
- }
- }
- impl ::protobuf::Message for MercuryRequest {
- fn is_initialized(&self) -> bool {
- true
- }
- fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
- while !is.eof()? {
- let (field_number, wire_type) = is.read_tag_unpack()?;
- match field_number {
- 1 => {
- ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)?;
- },
- 2 => {
- ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.content_type)?;
- },
- 3 => {
- ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.body)?;
- },
- 4 => {
- ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.etag)?;
- },
- _ => {
- ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
- },
- };
- }
- ::std::result::Result::Ok(())
- }
- // Compute sizes of nested messages
- #[allow(unused_variables)]
- fn compute_size(&self) -> u32 {
- let mut my_size = 0;
- if let Some(ref v) = self.uri.as_ref() {
- my_size += ::protobuf::rt::string_size(1, &v);
- }
- if let Some(ref v) = self.content_type.as_ref() {
- my_size += ::protobuf::rt::string_size(2, &v);
- }
- if let Some(ref v) = self.body.as_ref() {
- my_size += ::protobuf::rt::bytes_size(3, &v);
- }
- if let Some(ref v) = self.etag.as_ref() {
- my_size += ::protobuf::rt::bytes_size(4, &v);
- }
- my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
- self.cached_size.set(my_size);
- my_size
- }
- fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
- if let Some(ref v) = self.uri.as_ref() {
- os.write_string(1, &v)?;
- }
- if let Some(ref v) = self.content_type.as_ref() {
- os.write_string(2, &v)?;
- }
- if let Some(ref v) = self.body.as_ref() {
- os.write_bytes(3, &v)?;
- }
- if let Some(ref v) = self.etag.as_ref() {
- os.write_bytes(4, &v)?;
- }
- os.write_unknown_fields(self.get_unknown_fields())?;
- ::std::result::Result::Ok(())
- }
- fn get_cached_size(&self) -> u32 {
- self.cached_size.get()
- }
- fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
- &self.unknown_fields
- }
- fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
- &mut self.unknown_fields
- }
- fn as_any(&self) -> &dyn (::std::any::Any) {
- self as &dyn (::std::any::Any)
- }
- fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
- self as &mut dyn (::std::any::Any)
- }
- fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
- self
- }
- fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
- Self::descriptor_static()
- }
- fn new() -> MercuryRequest {
- MercuryRequest::new()
- }
- fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
- static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
- };
- unsafe {
- descriptor.get(|| {
- let mut fields = ::std::vec::Vec::new();
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
- "uri",
- |m: &MercuryRequest| { &m.uri },
- |m: &mut MercuryRequest| { &mut m.uri },
- ));
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
- "content_type",
- |m: &MercuryRequest| { &m.content_type },
- |m: &mut MercuryRequest| { &mut m.content_type },
- ));
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
- "body",
- |m: &MercuryRequest| { &m.body },
- |m: &mut MercuryRequest| { &mut m.body },
- ));
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
- "etag",
- |m: &MercuryRequest| { &m.etag },
- |m: &mut MercuryRequest| { &mut m.etag },
- ));
- ::protobuf::reflect::MessageDescriptor::new::<MercuryRequest>(
- "MercuryRequest",
- fields,
- file_descriptor_proto()
- )
- })
- }
- }
- fn default_instance() -> &'static MercuryRequest {
- static mut instance: ::protobuf::lazy::Lazy<MercuryRequest> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const MercuryRequest,
- };
- unsafe {
- instance.get(MercuryRequest::new)
- }
- }
- }
- impl ::protobuf::Clear for MercuryRequest {
- fn clear(&mut self) {
- self.uri.clear();
- self.content_type.clear();
- self.body.clear();
- self.etag.clear();
- self.unknown_fields.clear();
- }
- }
- impl ::std::fmt::Debug for MercuryRequest {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- ::protobuf::text_format::fmt(self, f)
- }
- }
- impl ::protobuf::reflect::ProtobufValue for MercuryRequest {
- fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
- ::protobuf::reflect::ProtobufValueRef::Message(self)
- }
- }
- #[derive(PartialEq,Clone,Default)]
- pub struct MercuryReply {
- // message fields
- status_code: ::std::option::Option<i32>,
- status_message: ::protobuf::SingularField<::std::string::String>,
- cache_policy: ::std::option::Option<MercuryReply_CachePolicy>,
- ttl: ::std::option::Option<i32>,
- etag: ::protobuf::SingularField<::std::vec::Vec<u8>>,
- content_type: ::protobuf::SingularField<::std::string::String>,
- body: ::protobuf::SingularField<::std::vec::Vec<u8>>,
- // special fields
- pub unknown_fields: ::protobuf::UnknownFields,
- pub cached_size: ::protobuf::CachedSize,
- }
- impl<'a> ::std::default::Default for &'a MercuryReply {
- fn default() -> &'a MercuryReply {
- <MercuryReply as ::protobuf::Message>::default_instance()
- }
- }
- impl MercuryReply {
- pub fn new() -> MercuryReply {
- ::std::default::Default::default()
- }
- // optional sint32 status_code = 1;
- pub fn get_status_code(&self) -> i32 {
- self.status_code.unwrap_or(0)
- }
- pub fn clear_status_code(&mut self) {
- self.status_code = ::std::option::Option::None;
- }
- pub fn has_status_code(&self) -> bool {
- self.status_code.is_some()
- }
- // Param is passed by value, moved
- pub fn set_status_code(&mut self, v: i32) {
- self.status_code = ::std::option::Option::Some(v);
- }
- // optional string status_message = 2;
- pub fn get_status_message(&self) -> &str {
- match self.status_message.as_ref() {
- Some(v) => &v,
- None => "",
- }
- }
- pub fn clear_status_message(&mut self) {
- self.status_message.clear();
- }
- pub fn has_status_message(&self) -> bool {
- self.status_message.is_some()
- }
- // Param is passed by value, moved
- pub fn set_status_message(&mut self, v: ::std::string::String) {
- self.status_message = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_status_message(&mut self) -> &mut ::std::string::String {
- if self.status_message.is_none() {
- self.status_message.set_default();
- }
- self.status_message.as_mut().unwrap()
- }
- // Take field
- pub fn take_status_message(&mut self) -> ::std::string::String {
- self.status_message.take().unwrap_or_else(|| ::std::string::String::new())
- }
- // optional .MercuryReply.CachePolicy cache_policy = 3;
- pub fn get_cache_policy(&self) -> MercuryReply_CachePolicy {
- self.cache_policy.unwrap_or(MercuryReply_CachePolicy::CACHE_NO)
- }
- pub fn clear_cache_policy(&mut self) {
- self.cache_policy = ::std::option::Option::None;
- }
- pub fn has_cache_policy(&self) -> bool {
- self.cache_policy.is_some()
- }
- // Param is passed by value, moved
- pub fn set_cache_policy(&mut self, v: MercuryReply_CachePolicy) {
- self.cache_policy = ::std::option::Option::Some(v);
- }
- // optional sint32 ttl = 4;
- pub fn get_ttl(&self) -> i32 {
- self.ttl.unwrap_or(0)
- }
- pub fn clear_ttl(&mut self) {
- self.ttl = ::std::option::Option::None;
- }
- pub fn has_ttl(&self) -> bool {
- self.ttl.is_some()
- }
- // Param is passed by value, moved
- pub fn set_ttl(&mut self, v: i32) {
- self.ttl = ::std::option::Option::Some(v);
- }
- // optional bytes etag = 5;
- pub fn get_etag(&self) -> &[u8] {
- match self.etag.as_ref() {
- Some(v) => &v,
- None => &[],
- }
- }
- pub fn clear_etag(&mut self) {
- self.etag.clear();
- }
- pub fn has_etag(&self) -> bool {
- self.etag.is_some()
- }
- // Param is passed by value, moved
- pub fn set_etag(&mut self, v: ::std::vec::Vec<u8>) {
- self.etag = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_etag(&mut self) -> &mut ::std::vec::Vec<u8> {
- if self.etag.is_none() {
- self.etag.set_default();
- }
- self.etag.as_mut().unwrap()
- }
- // Take field
- pub fn take_etag(&mut self) -> ::std::vec::Vec<u8> {
- self.etag.take().unwrap_or_else(|| ::std::vec::Vec::new())
- }
- // optional string content_type = 6;
- pub fn get_content_type(&self) -> &str {
- match self.content_type.as_ref() {
- Some(v) => &v,
- None => "",
- }
- }
- pub fn clear_content_type(&mut self) {
- self.content_type.clear();
- }
- pub fn has_content_type(&self) -> bool {
- self.content_type.is_some()
- }
- // Param is passed by value, moved
- pub fn set_content_type(&mut self, v: ::std::string::String) {
- self.content_type = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_content_type(&mut self) -> &mut ::std::string::String {
- if self.content_type.is_none() {
- self.content_type.set_default();
- }
- self.content_type.as_mut().unwrap()
- }
- // Take field
- pub fn take_content_type(&mut self) -> ::std::string::String {
- self.content_type.take().unwrap_or_else(|| ::std::string::String::new())
- }
- // optional bytes body = 7;
- pub fn get_body(&self) -> &[u8] {
- match self.body.as_ref() {
- Some(v) => &v,
- None => &[],
- }
- }
- pub fn clear_body(&mut self) {
- self.body.clear();
- }
- pub fn has_body(&self) -> bool {
- self.body.is_some()
- }
- // Param is passed by value, moved
- pub fn set_body(&mut self, v: ::std::vec::Vec<u8>) {
- self.body = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_body(&mut self) -> &mut ::std::vec::Vec<u8> {
- if self.body.is_none() {
- self.body.set_default();
- }
- self.body.as_mut().unwrap()
- }
- // Take field
- pub fn take_body(&mut self) -> ::std::vec::Vec<u8> {
- self.body.take().unwrap_or_else(|| ::std::vec::Vec::new())
- }
- }
- impl ::protobuf::Message for MercuryReply {
- fn is_initialized(&self) -> bool {
- true
- }
- fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
- while !is.eof()? {
- let (field_number, wire_type) = is.read_tag_unpack()?;
- match field_number {
- 1 => {
- if wire_type != ::protobuf::wire_format::WireTypeVarint {
- return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
- }
- let tmp = is.read_sint32()?;
- self.status_code = ::std::option::Option::Some(tmp);
- },
- 2 => {
- ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.status_message)?;
- },
- 3 => {
- ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.cache_policy, 3, &mut self.unknown_fields)?
- },
- 4 => {
- if wire_type != ::protobuf::wire_format::WireTypeVarint {
- return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
- }
- let tmp = is.read_sint32()?;
- self.ttl = ::std::option::Option::Some(tmp);
- },
- 5 => {
- ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.etag)?;
- },
- 6 => {
- ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.content_type)?;
- },
- 7 => {
- ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.body)?;
- },
- _ => {
- ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
- },
- };
- }
- ::std::result::Result::Ok(())
- }
- // Compute sizes of nested messages
- #[allow(unused_variables)]
- fn compute_size(&self) -> u32 {
- let mut my_size = 0;
- if let Some(v) = self.status_code {
- my_size += ::protobuf::rt::value_varint_zigzag_size(1, v);
- }
- if let Some(ref v) = self.status_message.as_ref() {
- my_size += ::protobuf::rt::string_size(2, &v);
- }
- if let Some(v) = self.cache_policy {
- my_size += ::protobuf::rt::enum_size(3, v);
- }
- if let Some(v) = self.ttl {
- my_size += ::protobuf::rt::value_varint_zigzag_size(4, v);
- }
- if let Some(ref v) = self.etag.as_ref() {
- my_size += ::protobuf::rt::bytes_size(5, &v);
- }
- if let Some(ref v) = self.content_type.as_ref() {
- my_size += ::protobuf::rt::string_size(6, &v);
- }
- if let Some(ref v) = self.body.as_ref() {
- my_size += ::protobuf::rt::bytes_size(7, &v);
- }
- my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
- self.cached_size.set(my_size);
- my_size
- }
- fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
- if let Some(v) = self.status_code {
- os.write_sint32(1, v)?;
- }
- if let Some(ref v) = self.status_message.as_ref() {
- os.write_string(2, &v)?;
- }
- if let Some(v) = self.cache_policy {
- os.write_enum(3, v.value())?;
- }
- if let Some(v) = self.ttl {
- os.write_sint32(4, v)?;
- }
- if let Some(ref v) = self.etag.as_ref() {
- os.write_bytes(5, &v)?;
- }
- if let Some(ref v) = self.content_type.as_ref() {
- os.write_string(6, &v)?;
- }
- if let Some(ref v) = self.body.as_ref() {
- os.write_bytes(7, &v)?;
- }
- os.write_unknown_fields(self.get_unknown_fields())?;
- ::std::result::Result::Ok(())
- }
- fn get_cached_size(&self) -> u32 {
- self.cached_size.get()
- }
- fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
- &self.unknown_fields
- }
- fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
- &mut self.unknown_fields
- }
- fn as_any(&self) -> &dyn (::std::any::Any) {
- self as &dyn (::std::any::Any)
- }
- fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
- self as &mut dyn (::std::any::Any)
- }
- fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
- self
- }
- fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
- Self::descriptor_static()
- }
- fn new() -> MercuryReply {
- MercuryReply::new()
- }
- fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
- static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
- };
- unsafe {
- descriptor.get(|| {
- let mut fields = ::std::vec::Vec::new();
- fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>(
- "status_code",
- |m: &MercuryReply| { &m.status_code },
- |m: &mut MercuryReply| { &mut m.status_code },
- ));
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
- "status_message",
- |m: &MercuryReply| { &m.status_message },
- |m: &mut MercuryReply| { &mut m.status_message },
- ));
- fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum<MercuryReply_CachePolicy>>(
- "cache_policy",
- |m: &MercuryReply| { &m.cache_policy },
- |m: &mut MercuryReply| { &mut m.cache_policy },
- ));
- fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>(
- "ttl",
- |m: &MercuryReply| { &m.ttl },
- |m: &mut MercuryReply| { &mut m.ttl },
- ));
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
- "etag",
- |m: &MercuryReply| { &m.etag },
- |m: &mut MercuryReply| { &mut m.etag },
- ));
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
- "content_type",
- |m: &MercuryReply| { &m.content_type },
- |m: &mut MercuryReply| { &mut m.content_type },
- ));
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
- "body",
- |m: &MercuryReply| { &m.body },
- |m: &mut MercuryReply| { &mut m.body },
- ));
- ::protobuf::reflect::MessageDescriptor::new::<MercuryReply>(
- "MercuryReply",
- fields,
- file_descriptor_proto()
- )
- })
- }
- }
- fn default_instance() -> &'static MercuryReply {
- static mut instance: ::protobuf::lazy::Lazy<MercuryReply> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const MercuryReply,
- };
- unsafe {
- instance.get(MercuryReply::new)
- }
- }
- }
- impl ::protobuf::Clear for MercuryReply {
- fn clear(&mut self) {
- self.status_code = ::std::option::Option::None;
- self.status_message.clear();
- self.cache_policy = ::std::option::Option::None;
- self.ttl = ::std::option::Option::None;
- self.etag.clear();
- self.content_type.clear();
- self.body.clear();
- self.unknown_fields.clear();
- }
- }
- impl ::std::fmt::Debug for MercuryReply {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- ::protobuf::text_format::fmt(self, f)
- }
- }
- impl ::protobuf::reflect::ProtobufValue for MercuryReply {
- fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
- ::protobuf::reflect::ProtobufValueRef::Message(self)
- }
- }
- #[derive(Clone,PartialEq,Eq,Debug,Hash)]
- pub enum MercuryReply_CachePolicy {
- CACHE_NO = 1,
- CACHE_PRIVATE = 2,
- CACHE_PUBLIC = 3,
- }
- impl ::protobuf::ProtobufEnum for MercuryReply_CachePolicy {
- fn value(&self) -> i32 {
- *self as i32
- }
- fn from_i32(value: i32) -> ::std::option::Option<MercuryReply_CachePolicy> {
- match value {
- 1 => ::std::option::Option::Some(MercuryReply_CachePolicy::CACHE_NO),
- 2 => ::std::option::Option::Some(MercuryReply_CachePolicy::CACHE_PRIVATE),
- 3 => ::std::option::Option::Some(MercuryReply_CachePolicy::CACHE_PUBLIC),
- _ => ::std::option::Option::None
- }
- }
- fn values() -> &'static [Self] {
- static values: &'static [MercuryReply_CachePolicy] = &[
- MercuryReply_CachePolicy::CACHE_NO,
- MercuryReply_CachePolicy::CACHE_PRIVATE,
- MercuryReply_CachePolicy::CACHE_PUBLIC,
- ];
- values
- }
- fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
- static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
- };
- unsafe {
- descriptor.get(|| {
- ::protobuf::reflect::EnumDescriptor::new("MercuryReply_CachePolicy", file_descriptor_proto())
- })
- }
- }
- }
- impl ::std::marker::Copy for MercuryReply_CachePolicy {
- }
- // Note, `Default` is implemented although default value is not 0
- impl ::std::default::Default for MercuryReply_CachePolicy {
- fn default() -> Self {
- MercuryReply_CachePolicy::CACHE_NO
- }
- }
- impl ::protobuf::reflect::ProtobufValue for MercuryReply_CachePolicy {
- fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
- ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
- }
- }
- #[derive(PartialEq,Clone,Default)]
- pub struct Header {
- // message fields
- uri: ::protobuf::SingularField<::std::string::String>,
- content_type: ::protobuf::SingularField<::std::string::String>,
- method: ::protobuf::SingularField<::std::string::String>,
- status_code: ::std::option::Option<i32>,
- user_fields: ::protobuf::RepeatedField<UserField>,
- // special fields
- pub unknown_fields: ::protobuf::UnknownFields,
- pub cached_size: ::protobuf::CachedSize,
- }
- impl<'a> ::std::default::Default for &'a Header {
- fn default() -> &'a Header {
- <Header as ::protobuf::Message>::default_instance()
- }
- }
- impl Header {
- pub fn new() -> Header {
- ::std::default::Default::default()
- }
- // optional string uri = 1;
- pub fn get_uri(&self) -> &str {
- match self.uri.as_ref() {
- Some(v) => &v,
- None => "",
- }
- }
- pub fn clear_uri(&mut self) {
- self.uri.clear();
- }
- pub fn has_uri(&self) -> bool {
- self.uri.is_some()
- }
- // Param is passed by value, moved
- pub fn set_uri(&mut self, v: ::std::string::String) {
- self.uri = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_uri(&mut self) -> &mut ::std::string::String {
- if self.uri.is_none() {
- self.uri.set_default();
- }
- self.uri.as_mut().unwrap()
- }
- // Take field
- pub fn take_uri(&mut self) -> ::std::string::String {
- self.uri.take().unwrap_or_else(|| ::std::string::String::new())
- }
- // optional string content_type = 2;
- pub fn get_content_type(&self) -> &str {
- match self.content_type.as_ref() {
- Some(v) => &v,
- None => "",
- }
- }
- pub fn clear_content_type(&mut self) {
- self.content_type.clear();
- }
- pub fn has_content_type(&self) -> bool {
- self.content_type.is_some()
- }
- // Param is passed by value, moved
- pub fn set_content_type(&mut self, v: ::std::string::String) {
- self.content_type = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_content_type(&mut self) -> &mut ::std::string::String {
- if self.content_type.is_none() {
- self.content_type.set_default();
- }
- self.content_type.as_mut().unwrap()
- }
- // Take field
- pub fn take_content_type(&mut self) -> ::std::string::String {
- self.content_type.take().unwrap_or_else(|| ::std::string::String::new())
- }
- // optional string method = 3;
- pub fn get_method(&self) -> &str {
- match self.method.as_ref() {
- Some(v) => &v,
- None => "",
- }
- }
- pub fn clear_method(&mut self) {
- self.method.clear();
- }
- pub fn has_method(&self) -> bool {
- self.method.is_some()
- }
- // Param is passed by value, moved
- pub fn set_method(&mut self, v: ::std::string::String) {
- self.method = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_method(&mut self) -> &mut ::std::string::String {
- if self.method.is_none() {
- self.method.set_default();
- }
- self.method.as_mut().unwrap()
- }
- // Take field
- pub fn take_method(&mut self) -> ::std::string::String {
- self.method.take().unwrap_or_else(|| ::std::string::String::new())
- }
- // optional sint32 status_code = 4;
- pub fn get_status_code(&self) -> i32 {
- self.status_code.unwrap_or(0)
- }
- pub fn clear_status_code(&mut self) {
- self.status_code = ::std::option::Option::None;
- }
- pub fn has_status_code(&self) -> bool {
- self.status_code.is_some()
- }
- // Param is passed by value, moved
- pub fn set_status_code(&mut self, v: i32) {
- self.status_code = ::std::option::Option::Some(v);
- }
- // repeated .UserField user_fields = 6;
- pub fn get_user_fields(&self) -> &[UserField] {
- &self.user_fields
- }
- pub fn clear_user_fields(&mut self) {
- self.user_fields.clear();
- }
- // Param is passed by value, moved
- pub fn set_user_fields(&mut self, v: ::protobuf::RepeatedField<UserField>) {
- self.user_fields = v;
- }
- // Mutable pointer to the field.
- pub fn mut_user_fields(&mut self) -> &mut ::protobuf::RepeatedField<UserField> {
- &mut self.user_fields
- }
- // Take field
- pub fn take_user_fields(&mut self) -> ::protobuf::RepeatedField<UserField> {
- ::std::mem::replace(&mut self.user_fields, ::protobuf::RepeatedField::new())
- }
- }
- impl ::protobuf::Message for Header {
- fn is_initialized(&self) -> bool {
- for v in &self.user_fields {
- if !v.is_initialized() {
- return false;
- }
- };
- true
- }
- fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
- while !is.eof()? {
- let (field_number, wire_type) = is.read_tag_unpack()?;
- match field_number {
- 1 => {
- ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)?;
- },
- 2 => {
- ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.content_type)?;
- },
- 3 => {
- ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.method)?;
- },
- 4 => {
- if wire_type != ::protobuf::wire_format::WireTypeVarint {
- return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
- }
- let tmp = is.read_sint32()?;
- self.status_code = ::std::option::Option::Some(tmp);
- },
- 6 => {
- ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.user_fields)?;
- },
- _ => {
- ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
- },
- };
- }
- ::std::result::Result::Ok(())
- }
- // Compute sizes of nested messages
- #[allow(unused_variables)]
- fn compute_size(&self) -> u32 {
- let mut my_size = 0;
- if let Some(ref v) = self.uri.as_ref() {
- my_size += ::protobuf::rt::string_size(1, &v);
- }
- if let Some(ref v) = self.content_type.as_ref() {
- my_size += ::protobuf::rt::string_size(2, &v);
- }
- if let Some(ref v) = self.method.as_ref() {
- my_size += ::protobuf::rt::string_size(3, &v);
- }
- if let Some(v) = self.status_code {
- my_size += ::protobuf::rt::value_varint_zigzag_size(4, v);
- }
- for value in &self.user_fields {
- let len = value.compute_size();
- my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
- };
- my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
- self.cached_size.set(my_size);
- my_size
- }
- fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
- if let Some(ref v) = self.uri.as_ref() {
- os.write_string(1, &v)?;
- }
- if let Some(ref v) = self.content_type.as_ref() {
- os.write_string(2, &v)?;
- }
- if let Some(ref v) = self.method.as_ref() {
- os.write_string(3, &v)?;
- }
- if let Some(v) = self.status_code {
- os.write_sint32(4, v)?;
- }
- for v in &self.user_fields {
- os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?;
- os.write_raw_varint32(v.get_cached_size())?;
- v.write_to_with_cached_sizes(os)?;
- };
- os.write_unknown_fields(self.get_unknown_fields())?;
- ::std::result::Result::Ok(())
- }
- fn get_cached_size(&self) -> u32 {
- self.cached_size.get()
- }
- fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
- &self.unknown_fields
- }
- fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
- &mut self.unknown_fields
- }
- fn as_any(&self) -> &dyn (::std::any::Any) {
- self as &dyn (::std::any::Any)
- }
- fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
- self as &mut dyn (::std::any::Any)
- }
- fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
- self
- }
- fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
- Self::descriptor_static()
- }
- fn new() -> Header {
- Header::new()
- }
- fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
- static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
- };
- unsafe {
- descriptor.get(|| {
- let mut fields = ::std::vec::Vec::new();
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
- "uri",
- |m: &Header| { &m.uri },
- |m: &mut Header| { &mut m.uri },
- ));
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
- "content_type",
- |m: &Header| { &m.content_type },
- |m: &mut Header| { &mut m.content_type },
- ));
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
- "method",
- |m: &Header| { &m.method },
- |m: &mut Header| { &mut m.method },
- ));
- fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>(
- "status_code",
- |m: &Header| { &m.status_code },
- |m: &mut Header| { &mut m.status_code },
- ));
- fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<UserField>>(
- "user_fields",
- |m: &Header| { &m.user_fields },
- |m: &mut Header| { &mut m.user_fields },
- ));
- ::protobuf::reflect::MessageDescriptor::new::<Header>(
- "Header",
- fields,
- file_descriptor_proto()
- )
- })
- }
- }
- fn default_instance() -> &'static Header {
- static mut instance: ::protobuf::lazy::Lazy<Header> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const Header,
- };
- unsafe {
- instance.get(Header::new)
- }
- }
- }
- impl ::protobuf::Clear for Header {
- fn clear(&mut self) {
- self.uri.clear();
- self.content_type.clear();
- self.method.clear();
- self.status_code = ::std::option::Option::None;
- self.user_fields.clear();
- self.unknown_fields.clear();
- }
- }
- impl ::std::fmt::Debug for Header {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- ::protobuf::text_format::fmt(self, f)
- }
- }
- impl ::protobuf::reflect::ProtobufValue for Header {
- fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
- ::protobuf::reflect::ProtobufValueRef::Message(self)
- }
- }
- #[derive(PartialEq,Clone,Default)]
- pub struct UserField {
- // message fields
- key: ::protobuf::SingularField<::std::string::String>,
- value: ::protobuf::SingularField<::std::vec::Vec<u8>>,
- // special fields
- pub unknown_fields: ::protobuf::UnknownFields,
- pub cached_size: ::protobuf::CachedSize,
- }
- impl<'a> ::std::default::Default for &'a UserField {
- fn default() -> &'a UserField {
- <UserField as ::protobuf::Message>::default_instance()
- }
- }
- impl UserField {
- pub fn new() -> UserField {
- ::std::default::Default::default()
- }
- // optional string key = 1;
- pub fn get_key(&self) -> &str {
- match self.key.as_ref() {
- Some(v) => &v,
- None => "",
- }
- }
- pub fn clear_key(&mut self) {
- self.key.clear();
- }
- pub fn has_key(&self) -> bool {
- self.key.is_some()
- }
- // Param is passed by value, moved
- pub fn set_key(&mut self, v: ::std::string::String) {
- self.key = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_key(&mut self) -> &mut ::std::string::String {
- if self.key.is_none() {
- self.key.set_default();
- }
- self.key.as_mut().unwrap()
- }
- // Take field
- pub fn take_key(&mut self) -> ::std::string::String {
- self.key.take().unwrap_or_else(|| ::std::string::String::new())
- }
- // optional bytes value = 2;
- pub fn get_value(&self) -> &[u8] {
- match self.value.as_ref() {
- Some(v) => &v,
- None => &[],
- }
- }
- pub fn clear_value(&mut self) {
- self.value.clear();
- }
- pub fn has_value(&self) -> bool {
- self.value.is_some()
- }
- // Param is passed by value, moved
- pub fn set_value(&mut self, v: ::std::vec::Vec<u8>) {
- self.value = ::protobuf::SingularField::some(v);
- }
- // Mutable pointer to the field.
- // If field is not initialized, it is initialized with default value first.
- pub fn mut_value(&mut self) -> &mut ::std::vec::Vec<u8> {
- if self.value.is_none() {
- self.value.set_default();
- }
- self.value.as_mut().unwrap()
- }
- // Take field
- pub fn take_value(&mut self) -> ::std::vec::Vec<u8> {
- self.value.take().unwrap_or_else(|| ::std::vec::Vec::new())
- }
- }
- impl ::protobuf::Message for UserField {
- fn is_initialized(&self) -> bool {
- true
- }
- fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
- while !is.eof()? {
- let (field_number, wire_type) = is.read_tag_unpack()?;
- match field_number {
- 1 => {
- ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.key)?;
- },
- 2 => {
- ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.value)?;
- },
- _ => {
- ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
- },
- };
- }
- ::std::result::Result::Ok(())
- }
- // Compute sizes of nested messages
- #[allow(unused_variables)]
- fn compute_size(&self) -> u32 {
- let mut my_size = 0;
- if let Some(ref v) = self.key.as_ref() {
- my_size += ::protobuf::rt::string_size(1, &v);
- }
- if let Some(ref v) = self.value.as_ref() {
- my_size += ::protobuf::rt::bytes_size(2, &v);
- }
- my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
- self.cached_size.set(my_size);
- my_size
- }
- fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
- if let Some(ref v) = self.key.as_ref() {
- os.write_string(1, &v)?;
- }
- if let Some(ref v) = self.value.as_ref() {
- os.write_bytes(2, &v)?;
- }
- os.write_unknown_fields(self.get_unknown_fields())?;
- ::std::result::Result::Ok(())
- }
- fn get_cached_size(&self) -> u32 {
- self.cached_size.get()
- }
- fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
- &self.unknown_fields
- }
- fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
- &mut self.unknown_fields
- }
- fn as_any(&self) -> &dyn (::std::any::Any) {
- self as &dyn (::std::any::Any)
- }
- fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
- self as &mut dyn (::std::any::Any)
- }
- fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
- self
- }
- fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
- Self::descriptor_static()
- }
- fn new() -> UserField {
- UserField::new()
- }
- fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
- static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
- };
- unsafe {
- descriptor.get(|| {
- let mut fields = ::std::vec::Vec::new();
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
- "key",
- |m: &UserField| { &m.key },
- |m: &mut UserField| { &mut m.key },
- ));
- fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
- "value",
- |m: &UserField| { &m.value },
- |m: &mut UserField| { &mut m.value },
- ));
- ::protobuf::reflect::MessageDescriptor::new::<UserField>(
- "UserField",
- fields,
- file_descriptor_proto()
- )
- })
- }
- }
- fn default_instance() -> &'static UserField {
- static mut instance: ::protobuf::lazy::Lazy<UserField> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const UserField,
- };
- unsafe {
- instance.get(UserField::new)
- }
- }
- }
- impl ::protobuf::Clear for UserField {
- fn clear(&mut self) {
- self.key.clear();
- self.value.clear();
- self.unknown_fields.clear();
- }
- }
- impl ::std::fmt::Debug for UserField {
- fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
- ::protobuf::text_format::fmt(self, f)
- }
- }
- impl ::protobuf::reflect::ProtobufValue for UserField {
- fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
- ::protobuf::reflect::ProtobufValueRef::Message(self)
- }
- }
- static file_descriptor_proto_data: &'static [u8] = b"\
- \n\rmercury.proto\x12\0\">\n\x16MercuryMultiGetRequest\x12\"\n\x07reques\
- t\x18\x01\x20\x03(\x0b2\x0f.MercuryRequestB\0:\0\"8\n\x14MercuryMultiGet\
- Reply\x12\x1e\n\x05reply\x18\x01\x20\x03(\x0b2\r.MercuryReplyB\0:\0\"Y\n\
- \x0eMercuryRequest\x12\r\n\x03uri\x18\x01\x20\x01(\tB\0\x12\x16\n\x0ccon\
- tent_type\x18\x02\x20\x01(\tB\0\x12\x0e\n\x04body\x18\x03\x20\x01(\x0cB\
- \0\x12\x0e\n\x04etag\x18\x04\x20\x01(\x0cB\0:\0\"\xff\x01\n\x0cMercuryRe\
- ply\x12\x15\n\x0bstatus_code\x18\x01\x20\x01(\x11B\0\x12\x18\n\x0estatus\
- _message\x18\x02\x20\x01(\tB\0\x121\n\x0ccache_policy\x18\x03\x20\x01(\
- \x0e2\x19.MercuryReply.CachePolicyB\0\x12\r\n\x03ttl\x18\x04\x20\x01(\
- \x11B\0\x12\x0e\n\x04etag\x18\x05\x20\x01(\x0cB\0\x12\x16\n\x0ccontent_t\
- ype\x18\x06\x20\x01(\tB\0\x12\x0e\n\x04body\x18\x07\x20\x01(\x0cB\0\"B\n\
- \x0bCachePolicy\x12\x0c\n\x08CACHE_NO\x10\x01\x12\x11\n\rCACHE_PRIVATE\
- \x10\x02\x12\x10\n\x0cCACHE_PUBLIC\x10\x03\x1a\0:\0\"}\n\x06Header\x12\r\
- \n\x03uri\x18\x01\x20\x01(\tB\0\x12\x16\n\x0ccontent_type\x18\x02\x20\
- \x01(\tB\0\x12\x10\n\x06method\x18\x03\x20\x01(\tB\0\x12\x15\n\x0bstatus\
- _code\x18\x04\x20\x01(\x11B\0\x12!\n\x0buser_fields\x18\x06\x20\x03(\x0b\
- 2\n.UserFieldB\0:\0\"-\n\tUserField\x12\r\n\x03key\x18\x01\x20\x01(\tB\0\
- \x12\x0f\n\x05value\x18\x02\x20\x01(\x0cB\0:\0B\0b\x06proto2\
- ";
- static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
- lock: ::protobuf::lazy::ONCE_INIT,
- ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
- };
- fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
- ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
- }
- pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
- unsafe {
- file_descriptor_proto_lazy.get(|| {
- parse_descriptor_proto()
- })
- }
- }
|