Struct mesh::payload::protobuf::FieldSizer
source · pub struct FieldSizer<'a> { /* private fields */ }
Expand description
Type used to compute the size of field values.
Implementations§
source§impl<'a> FieldSizer<'a>
impl<'a> FieldSizer<'a>
sourcepub fn sequence(self) -> SequenceSizer<'a>
pub fn sequence(self) -> SequenceSizer<'a>
Returns a sequence sizer for sizing the field multiple times.
Panics if called while already sizing a sequence, since this would result in an invalid protobuf message.
sourcepub fn write_empty(&self) -> bool
pub fn write_empty(&self) -> bool
If true, encoders must write their fields even if they are empty.
sourcepub fn message<F>(self, f: F)where
F: FnOnce(MessageSizer<'_>),
pub fn message<F>(self, f: F)where
F: FnOnce(MessageSizer<'_>),
Computes the size for a message. Calls f
with a MessageSizer
to
calculate the size of each field.
sourcepub fn packed<F>(self, f: F)where
F: FnOnce(PackedSizer<'_>),
pub fn packed<F>(self, f: F)where
F: FnOnce(PackedSizer<'_>),
Computes the size of a packed value. Calls f
with a PackedSizer
to
sum the size of each element.
Auto Trait Implementations§
impl<'a> Freeze for FieldSizer<'a>
impl<'a> RefUnwindSafe for FieldSizer<'a>
impl<'a> Send for FieldSizer<'a>
impl<'a> Sync for FieldSizer<'a>
impl<'a> Unpin for FieldSizer<'a>
impl<'a> !UnwindSafe for FieldSizer<'a>
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