pub struct TestPayload {
pub str: Vec<String>,
pub nested: Vec<TestPayload>,
pub single_string: Option<String>,
pub single_int: Option<i32>,
pub repeated_ints: Vec<i32>,
pub remaining_nesting_depth: Option<u32>,
pub debug_annotations: Vec<DebugAnnotation>,
}
Fields§
§str: Vec<String>
§nested: Vec<TestPayload>
§single_string: Option<String>
§single_int: Option<i32>
§repeated_ints: Vec<i32>
§remaining_nesting_depth: Option<u32>
When 0 this is the bottom-most nested message.
debug_annotations: Vec<DebugAnnotation>
Implementations§
Source§impl TestPayload
impl TestPayload
Sourcepub fn remaining_nesting_depth(&self) -> u32
pub fn remaining_nesting_depth(&self) -> u32
Returns the value of remaining_nesting_depth
, or the default value if remaining_nesting_depth
is unset.
Sourcepub fn single_string(&self) -> &str
pub fn single_string(&self) -> &str
Returns the value of single_string
, or the default value if single_string
is unset.
Sourcepub fn single_int(&self) -> i32
pub fn single_int(&self) -> i32
Returns the value of single_int
, or the default value if single_int
is unset.
Trait Implementations§
Source§impl Clone for TestPayload
impl Clone for TestPayload
Source§fn clone(&self) -> TestPayload
fn clone(&self) -> TestPayload
Returns a copy 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 TestPayload
impl Debug for TestPayload
Source§impl Default for TestPayload
impl Default for TestPayload
Source§impl Message for TestPayload
impl Message for TestPayload
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_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Encodes the message to a newly allocated buffer.
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 encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
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<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 TestPayload
impl PartialEq for TestPayload
impl StructuralPartialEq for TestPayload
Auto Trait Implementations§
impl Freeze for TestPayload
impl RefUnwindSafe for TestPayload
impl Send for TestPayload
impl Sync for TestPayload
impl Unpin for TestPayload
impl UnwindSafe for TestPayload
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