|
| 1 | +// This file is generated by rust-protobuf 3.0.0-pre. Do not edit |
| 2 | +// .proto file is parsed by protoc --rust-out=... |
| 3 | +// @generated |
| 4 | + |
| 5 | +// https://github.com/rust-lang/rust-clippy/issues/702 |
| 6 | +#![allow(unknown_lints)] |
| 7 | +#![allow(clippy::all)] |
| 8 | + |
| 9 | +#![cfg_attr(rustfmt, rustfmt_skip)] |
| 10 | + |
| 11 | +#![allow(box_pointers)] |
| 12 | +#![allow(dead_code)] |
| 13 | +#![allow(missing_docs)] |
| 14 | +#![allow(non_camel_case_types)] |
| 15 | +#![allow(non_snake_case)] |
| 16 | +#![allow(non_upper_case_globals)] |
| 17 | +#![allow(trivial_casts)] |
| 18 | +#![allow(unused_imports)] |
| 19 | +#![allow(unused_results)] |
| 20 | + |
| 21 | +//! Generated file from `doctest_pb.proto` |
| 22 | +
|
| 23 | +#[derive(PartialEq,Clone,Default)] |
| 24 | +#[cfg_attr(serde, derive(Serialize, Deserialize))] |
| 25 | +pub struct MyMessage { |
| 26 | + // special fields |
| 27 | + #[cfg_attr(serde, serde(skip))] |
| 28 | + pub unknown_fields: crate::UnknownFields, |
| 29 | + #[cfg_attr(serde, serde(skip))] |
| 30 | + pub cached_size: crate::rt::CachedSize, |
| 31 | +} |
| 32 | + |
| 33 | +impl<'a> ::std::default::Default for &'a MyMessage { |
| 34 | + fn default() -> &'a MyMessage { |
| 35 | + <MyMessage as crate::Message>::default_instance() |
| 36 | + } |
| 37 | +} |
| 38 | + |
| 39 | +impl MyMessage { |
| 40 | + pub fn new() -> MyMessage { |
| 41 | + ::std::default::Default::default() |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | +impl crate::Message for MyMessage { |
| 46 | + fn is_initialized(&self) -> bool { |
| 47 | + true |
| 48 | + } |
| 49 | + |
| 50 | + fn merge_from(&mut self, is: &mut crate::CodedInputStream<'_>) -> crate::ProtobufResult<()> { |
| 51 | + while !is.eof()? { |
| 52 | + let (field_number, wire_type) = is.read_tag_unpack()?; |
| 53 | + match field_number { |
| 54 | + _ => { |
| 55 | + crate::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; |
| 56 | + }, |
| 57 | + }; |
| 58 | + } |
| 59 | + ::std::result::Result::Ok(()) |
| 60 | + } |
| 61 | + |
| 62 | + // Compute sizes of nested messages |
| 63 | + #[allow(unused_variables)] |
| 64 | + fn compute_size(&self) -> u32 { |
| 65 | + let mut my_size = 0; |
| 66 | + my_size += crate::rt::unknown_fields_size(self.get_unknown_fields()); |
| 67 | + self.cached_size.set(my_size); |
| 68 | + my_size |
| 69 | + } |
| 70 | + |
| 71 | + fn write_to_with_cached_sizes(&self, os: &mut crate::CodedOutputStream<'_>) -> crate::ProtobufResult<()> { |
| 72 | + os.write_unknown_fields(self.get_unknown_fields())?; |
| 73 | + ::std::result::Result::Ok(()) |
| 74 | + } |
| 75 | + |
| 76 | + fn get_cached_size(&self) -> u32 { |
| 77 | + self.cached_size.get() |
| 78 | + } |
| 79 | + |
| 80 | + fn get_unknown_fields(&self) -> &crate::UnknownFields { |
| 81 | + &self.unknown_fields |
| 82 | + } |
| 83 | + |
| 84 | + fn mut_unknown_fields(&mut self) -> &mut crate::UnknownFields { |
| 85 | + &mut self.unknown_fields |
| 86 | + } |
| 87 | + |
| 88 | + fn descriptor(&self) -> &'static crate::reflect::MessageDescriptor { |
| 89 | + Self::descriptor_static() |
| 90 | + } |
| 91 | + |
| 92 | + fn new() -> MyMessage { |
| 93 | + MyMessage::new() |
| 94 | + } |
| 95 | + |
| 96 | + fn descriptor_static() -> &'static crate::reflect::MessageDescriptor { |
| 97 | + static descriptor: crate::rt::Lazy<crate::reflect::MessageDescriptor> = crate::rt::Lazy::INIT; |
| 98 | + descriptor.get(|| { |
| 99 | + let fields = ::std::vec::Vec::new(); |
| 100 | + crate::reflect::MessageDescriptor::new::<MyMessage>( |
| 101 | + "MyMessage", |
| 102 | + fields, |
| 103 | + file_descriptor_proto() |
| 104 | + ) |
| 105 | + }) |
| 106 | + } |
| 107 | + |
| 108 | + fn default_instance() -> &'static MyMessage { |
| 109 | + static instance: crate::rt::Lazy<MyMessage> = crate::rt::Lazy::INIT; |
| 110 | + instance.get(MyMessage::new) |
| 111 | + } |
| 112 | +} |
| 113 | + |
| 114 | +impl crate::Clear for MyMessage { |
| 115 | + fn clear(&mut self) { |
| 116 | + self.unknown_fields.clear(); |
| 117 | + } |
| 118 | +} |
| 119 | + |
| 120 | +impl ::std::fmt::Debug for MyMessage { |
| 121 | + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { |
| 122 | + crate::text_format::fmt(self, f) |
| 123 | + } |
| 124 | +} |
| 125 | + |
| 126 | +impl crate::reflect::ProtobufValue for MyMessage { |
| 127 | +} |
| 128 | + |
| 129 | +static file_descriptor_proto_data: &'static [u8] = b"\ |
| 130 | + \n\x10doctest_pb.proto\"\x0b\n\tMyMessageJG\n\x06\x12\x04\x02\0\x05\x01\ |
| 131 | + \n%\n\x01\x0c\x12\x03\x02\0\x122\x1b\x20Messages\x20used\x20in\x20doctes\ |
| 132 | + ts\n\n\n\n\x02\x04\0\x12\x04\x04\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\ |
| 133 | + \x04\x08\x11b\x06proto3\ |
| 134 | +"; |
| 135 | + |
| 136 | +static file_descriptor_proto_lazy: crate::rt::Lazy<crate::descriptor::FileDescriptorProto> = crate::rt::Lazy::INIT; |
| 137 | + |
| 138 | +fn parse_descriptor_proto() -> crate::descriptor::FileDescriptorProto { |
| 139 | + crate::parse_from_bytes(file_descriptor_proto_data).unwrap() |
| 140 | +} |
| 141 | + |
| 142 | +/// `FileDescriptorProto` object which was a source for this generated file |
| 143 | +pub fn file_descriptor_proto() -> &'static crate::descriptor::FileDescriptorProto { |
| 144 | + file_descriptor_proto_lazy.get(|| { |
| 145 | + parse_descriptor_proto() |
| 146 | + }) |
| 147 | +} |
0 commit comments