pub struct TestAllTypes {Show 47 fields
pub optional_int32: i32,
pub optional_int64: i64,
pub optional_uint32: u32,
pub optional_uint64: u64,
pub optional_sint32: i32,
pub optional_sint64: i64,
pub optional_fixed32: u32,
pub optional_fixed64: u64,
pub optional_sfixed32: i32,
pub optional_sfixed64: i64,
pub optional_float: f32,
pub optional_double: f64,
pub optional_bool: bool,
pub optional_string: String,
pub optional_bytes: Vec<u8>,
pub optional_nested_message: Option<NestedMessage>,
pub optional_foreign_message: Option<ForeignMessage>,
pub optional_nested_enum: i32,
pub optional_foreign_enum: i32,
pub optional_cord: String,
pub repeated_int32: Vec<i32>,
pub repeated_int64: Vec<i64>,
pub repeated_uint32: Vec<u32>,
pub repeated_uint64: Vec<u64>,
pub repeated_sint32: Vec<i32>,
pub repeated_sint64: Vec<i64>,
pub repeated_fixed32: Vec<u32>,
pub repeated_fixed64: Vec<u64>,
pub repeated_sfixed32: Vec<i32>,
pub repeated_sfixed64: Vec<i64>,
pub repeated_float: Vec<f32>,
pub repeated_double: Vec<f64>,
pub repeated_bool: Vec<bool>,
pub repeated_string: Vec<String>,
pub repeated_bytes: Vec<Vec<u8>>,
pub repeated_nested_message: Vec<NestedMessage>,
pub repeated_nested_enum: Vec<i32>,
pub repeated_cord: Vec<String>,
pub map_string_to_message: HashMap<String, NestedMessage>,
pub map_int32_to_message: HashMap<i32, NestedMessage>,
pub map_int64_to_message: HashMap<i64, NestedMessage>,
pub map_bool_to_message: HashMap<bool, NestedMessage>,
pub map_string_to_int64: HashMap<String, i64>,
pub map_int64_to_string: HashMap<i64, String>,
pub another_map_string_to_message: HashMap<String, NestedMessage>,
pub packed_repeated_int64: Vec<i64>,
pub oneof_field: Option<OneofField>,
}
Fields§
§optional_int32: i32
Singular
use large tag to test output order.
optional_int64: i64
§optional_uint32: u32
§optional_uint64: u64
use large tag to test output order.
optional_sint32: i32
§optional_sint64: i64
§optional_fixed32: u32
§optional_fixed64: u64
§optional_sfixed32: i32
§optional_sfixed64: i64
§optional_float: f32
§optional_double: f64
§optional_bool: bool
§optional_string: String
§optional_bytes: Vec<u8>
§optional_nested_message: Option<NestedMessage>
§optional_foreign_message: Option<ForeignMessage>
§optional_nested_enum: i32
§optional_foreign_enum: i32
§optional_cord: String
§repeated_int32: Vec<i32>
Repeated
repeated_int64: Vec<i64>
§repeated_uint32: Vec<u32>
§repeated_uint64: Vec<u64>
§repeated_sint32: Vec<i32>
§repeated_sint64: Vec<i64>
§repeated_fixed32: Vec<u32>
§repeated_fixed64: Vec<u64>
§repeated_sfixed32: Vec<i32>
§repeated_sfixed64: Vec<i64>
§repeated_float: Vec<f32>
§repeated_double: Vec<f64>
§repeated_bool: Vec<bool>
§repeated_string: Vec<String>
§repeated_bytes: Vec<Vec<u8>>
§repeated_nested_message: Vec<NestedMessage>
§repeated_nested_enum: Vec<i32>
§repeated_cord: Vec<String>
§map_string_to_message: HashMap<String, NestedMessage>
§map_int32_to_message: HashMap<i32, NestedMessage>
§map_int64_to_message: HashMap<i64, NestedMessage>
§map_bool_to_message: HashMap<bool, NestedMessage>
§map_string_to_int64: HashMap<String, i64>
§map_int64_to_string: HashMap<i64, String>
§another_map_string_to_message: HashMap<String, NestedMessage>
§packed_repeated_int64: Vec<i64>
§oneof_field: Option<OneofField>
Implementations§
Source§impl TestAllTypes
impl TestAllTypes
Sourcepub fn optional_nested_enum(&self) -> NestedEnum
pub fn optional_nested_enum(&self) -> NestedEnum
Returns the enum value of optional_nested_enum
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_optional_nested_enum(&mut self, value: NestedEnum)
pub fn set_optional_nested_enum(&mut self, value: NestedEnum)
Sets optional_nested_enum
to the provided enum value.
Sourcepub fn optional_foreign_enum(&self) -> ForeignEnum
pub fn optional_foreign_enum(&self) -> ForeignEnum
Returns the enum value of optional_foreign_enum
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_optional_foreign_enum(&mut self, value: ForeignEnum)
pub fn set_optional_foreign_enum(&mut self, value: ForeignEnum)
Sets optional_foreign_enum
to the provided enum value.
Sourcepub fn repeated_nested_enum(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<NestedEnum>>
pub fn repeated_nested_enum( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<NestedEnum>>
Returns an iterator which yields the valid enum values contained in repeated_nested_enum
.
Sourcepub fn push_repeated_nested_enum(&mut self, value: NestedEnum)
pub fn push_repeated_nested_enum(&mut self, value: NestedEnum)
Appends the provided enum value to repeated_nested_enum
.
Trait Implementations§
Source§impl Clone for TestAllTypes
impl Clone for TestAllTypes
Source§fn clone(&self) -> TestAllTypes
fn clone(&self) -> TestAllTypes
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TestAllTypes
impl Debug for TestAllTypes
Source§impl Default for TestAllTypes
impl Default for TestAllTypes
Source§impl Message for TestAllTypes
impl Message for TestAllTypes
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message to a buffer. Read more
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes a length-delimited instance of the message from buffer, and
merges it into
self
.Source§impl PartialEq for TestAllTypes
impl PartialEq for TestAllTypes
impl StructuralPartialEq for TestAllTypes
Auto Trait Implementations§
impl Freeze for TestAllTypes
impl RefUnwindSafe for TestAllTypes
impl Send for TestAllTypes
impl Sync for TestAllTypes
impl Unpin for TestAllTypes
impl UnwindSafe for TestAllTypes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more