pub enum UnitField {
Unit(i32),
UnitStr(String),
}Expand description
The unit weights are expressed in. Set the well-known unit when one
fits, otherwise set unit_str to a custom label.
Variants§
Unit(i32)
A well-known unit from the Unit enum.
UnitStr(String)
A custom unit label, used when no Unit enum value fits.
Implementations§
Source§impl UnitField
impl UnitField
Sourcepub fn merge(
field: &mut Option<UnitField>,
tag: u32,
wire_type: WireType,
buf: &mut impl Buf,
ctx: DecodeContext,
) -> Result<(), DecodeError>
pub fn merge( field: &mut Option<UnitField>, tag: u32, wire_type: WireType, buf: &mut impl Buf, ctx: DecodeContext, ) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into self.
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Trait Implementations§
impl Eq for UnitField
impl StructuralPartialEq for UnitField
Auto Trait Implementations§
impl Freeze for UnitField
impl RefUnwindSafe for UnitField
impl Send for UnitField
impl Sync for UnitField
impl Unpin for UnitField
impl UnsafeUnpin for UnitField
impl UnwindSafe for UnitField
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