Struct TestAllTypes

Source
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

Source

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.

Source

pub fn set_optional_nested_enum(&mut self, value: NestedEnum)

Sets optional_nested_enum to the provided enum value.

Source

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.

Source

pub fn set_optional_foreign_enum(&mut self, value: ForeignEnum)

Sets optional_foreign_enum to the provided enum value.

Source

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.

Source

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

Source§

fn clone(&self) -> TestAllTypes

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TestAllTypes

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TestAllTypes

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for TestAllTypes

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for TestAllTypes

Source§

fn eq(&self, other: &TestAllTypes) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for TestAllTypes

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.