KitchenSink

Struct KitchenSink 

Source
pub struct KitchenSink {
Show 52 fields pub i32: i32, pub optional_i32: Option<i32>, pub repeated_i32: Vec<i32>, pub u32: u32, pub optional_u32: Option<u32>, pub repeated_u32: Vec<u32>, pub i64: i64, pub optional_i64: Option<i64>, pub repeated_i64: Vec<i64>, pub u64: u64, pub optional_u64: Option<u64>, pub repeated_u64: Vec<u64>, pub value: i32, pub optional_value: Option<i32>, pub repeated_value: Vec<i32>, pub prefix: i32, pub empty: Option<Empty>, pub string_dict: HashMap<String, String>, pub message_dict: HashMap<String, Empty>, pub enum_dict: HashMap<String, i32>, pub int64_dict: HashMap<i64, i32>, pub int32_dict: HashMap<i32, i32>, pub integer_dict: HashMap<i32, u64>, pub bool: bool, pub optional_bool: Option<bool>, pub repeated_bool: Vec<bool>, pub bytes: Bytes, pub optional_bytes: Option<Bytes>, pub repeated_bytes: Vec<Bytes>, pub string: String, pub optional_string: Option<String>, pub duration: Option<Duration>, pub timestamp: Option<Timestamp>, pub external_message: Option<ExternMessage>, pub external_enum: i32, pub common_message: Option<CommonMessage>, pub common_enum: i32, pub mixed_case: i32, pub string_bytes_dict: HashMap<String, Bytes>, pub int_bytes_dict: HashMap<i32, Bytes>, pub bool_value: Option<BoolValue>, pub bytes_value: Option<BytesValue>, pub double_value: Option<DoubleValue>, pub float_value: Option<FloatValue>, pub int32_value: Option<Int32Value>, pub int64_value: Option<Int64Value>, pub string_value: Option<StringValue>, pub uint32_value: Option<UInt32Value>, pub uint64_value: Option<UInt64Value>, pub repeated_int32_value: Vec<Int32Value>, pub map_int32_value: HashMap<String, Int32Value>, pub one_of: Option<OneOf>,
}

Fields§

§i32: i32§optional_i32: Option<i32>§repeated_i32: Vec<i32>§u32: u32§optional_u32: Option<u32>§repeated_u32: Vec<u32>§i64: i64§optional_i64: Option<i64>§repeated_i64: Vec<i64>§u64: u64§optional_u64: Option<u64>§repeated_u64: Vec<u64>§value: i32§optional_value: Option<i32>§repeated_value: Vec<i32>§prefix: i32§empty: Option<Empty>§string_dict: HashMap<String, String>§message_dict: HashMap<String, Empty>§enum_dict: HashMap<String, i32>§int64_dict: HashMap<i64, i32>§int32_dict: HashMap<i32, i32>§integer_dict: HashMap<i32, u64>§bool: bool§optional_bool: Option<bool>§repeated_bool: Vec<bool>§bytes: Bytes§optional_bytes: Option<Bytes>§repeated_bytes: Vec<Bytes>§string: String§optional_string: Option<String>§duration: Option<Duration>§timestamp: Option<Timestamp>§external_message: Option<ExternMessage>

An externally defined message

§external_enum: i32§common_message: Option<CommonMessage>

Messages from an external package

§common_enum: i32§mixed_case: i32§string_bytes_dict: HashMap<String, Bytes>§int_bytes_dict: HashMap<i32, Bytes>§bool_value: Option<BoolValue>§bytes_value: Option<BytesValue>§double_value: Option<DoubleValue>§float_value: Option<FloatValue>§int32_value: Option<Int32Value>§int64_value: Option<Int64Value>§string_value: Option<StringValue>§uint32_value: Option<UInt32Value>§uint64_value: Option<UInt64Value>§repeated_int32_value: Vec<Int32Value>§map_int32_value: HashMap<String, Int32Value>§one_of: Option<OneOf>

Implementations§

Source§

impl KitchenSink

Source

pub fn optional_i32(&self) -> i32

Returns the value of optional_i32, or the default value if optional_i32 is unset.

Source

pub fn optional_u32(&self) -> u32

Returns the value of optional_u32, or the default value if optional_u32 is unset.

Source

pub fn optional_i64(&self) -> i64

Returns the value of optional_i64, or the default value if optional_i64 is unset.

Source

pub fn optional_u64(&self) -> u64

Returns the value of optional_u64, or the default value if optional_u64 is unset.

Source

pub fn value(&self) -> Value

Returns the enum value of value, or the default if the field is set to an invalid enum value.

Source

pub fn set_value(&mut self, value: Value)

Sets value to the provided enum value.

Source

pub fn optional_value(&self) -> Value

Returns the enum value of optional_value, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_optional_value(&mut self, value: Value)

Sets optional_value to the provided enum value.

Source

pub fn repeated_value( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<Value>>

Returns an iterator which yields the valid enum values contained in repeated_value.

Source

pub fn push_repeated_value(&mut self, value: Value)

Appends the provided enum value to repeated_value.

Source

pub fn prefix(&self) -> Prefix

Returns the enum value of prefix, or the default if the field is set to an invalid enum value.

Source

pub fn set_prefix(&mut self, value: Prefix)

Sets prefix to the provided enum value.

Source

pub fn get_enum_dict(&self, key: &str) -> Option<Prefix>

Returns the enum value for the corresponding key in enum_dict, or None if the entry does not exist or it is not a valid enum value.

Source

pub fn insert_enum_dict(&mut self, key: String, value: Prefix) -> Option<Prefix>

Inserts a key value pair into enum_dict.

Source

pub fn get_int64_dict(&self, key: i64) -> Option<Prefix>

Returns the enum value for the corresponding key in int64_dict, or None if the entry does not exist or it is not a valid enum value.

Source

pub fn insert_int64_dict(&mut self, key: i64, value: Prefix) -> Option<Prefix>

Inserts a key value pair into int64_dict.

Source

pub fn get_int32_dict(&self, key: i32) -> Option<Prefix>

Returns the enum value for the corresponding key in int32_dict, or None if the entry does not exist or it is not a valid enum value.

Source

pub fn insert_int32_dict(&mut self, key: i32, value: Prefix) -> Option<Prefix>

Inserts a key value pair into int32_dict.

Source

pub fn optional_bool(&self) -> bool

Returns the value of optional_bool, or the default value if optional_bool is unset.

Source

pub fn optional_bytes(&self) -> &[u8]

Returns the value of optional_bytes, or the default value if optional_bytes is unset.

Source

pub fn optional_string(&self) -> &str

Returns the value of optional_string, or the default value if optional_string is unset.

Source

pub fn external_enum(&self) -> ExternEnumeration

Returns the enum value of external_enum, or the default if the field is set to an invalid enum value.

Source

pub fn set_external_enum(&mut self, value: ExternEnumeration)

Sets external_enum to the provided enum value.

Source

pub fn common_enum(&self) -> CommonEnumeration

Returns the enum value of common_enum, or the default if the field is set to an invalid enum value.

Source

pub fn set_common_enum(&mut self, value: CommonEnumeration)

Sets common_enum to the provided enum value.

Source

pub fn mixed_case(&self) -> MixedCase

Returns the enum value of mixed_case, or the default if the field is set to an invalid enum value.

Source

pub fn set_mixed_case(&mut self, value: MixedCase)

Sets mixed_case to the provided enum value.

Trait Implementations§

Source§

impl Clone for KitchenSink

Source§

fn clone(&self) -> KitchenSink

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 KitchenSink

Source§

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

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

impl Default for KitchenSink

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for KitchenSink

§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Message for KitchenSink

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(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

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

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

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

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

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

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

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

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

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

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

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

impl PartialEq for KitchenSink

Source§

fn eq(&self, other: &KitchenSink) -> 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.
§

impl Serialize for KitchenSink

§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for KitchenSink

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,