#[non_exhaustive]pub enum Len {
Bytes(usize),
Field {
by: By,
cap: Option<usize>,
align: Option<u64>,
},
Until {
terminator: u8,
},
Fill,
}Expand description
A byte length.
Count counts elements instead.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Bytes(usize)
A fixed number of bytes.
Field
Read from an earlier field. Encode writes the field from the actual length.
Fields
§
align: Option<u64>Padding that is not part of the length: #[align(N)].
The value takes exactly the stated length, and zero bytes follow it up to the next
multiple of N bytes, counted from the value’s first byte. Decode skips them without
reading them, and encode writes them. The message’s SEGMENTS give them a row of
their own, of Span::Pad.
Until
Up to and including the first terminator byte.
Fill
To the end of the body.
Trait Implementations§
impl Eq for Len
impl StructuralPartialEq for Len
Auto Trait Implementations§
impl Freeze for Len
impl RefUnwindSafe for Len
impl Send for Len
impl Sync for Len
impl Unpin for Len
impl UnsafeUnpin for Len
impl UnwindSafe for Len
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