Struct Vbi
pub struct Vbi(u32);Expand description
Variable Byte Integer (VBI) as defined in MQTT v5 §1.5.5.
Tuple Fields§
§0: u32Implementations§
§impl Vbi
impl Vbi
pub const MIN: Self
pub const MIN: Self
The minimum value.
pub const MAX: Self
pub const MAX: Self
The maximum value.
pub const MAX_USIZE: usize = 268_435_455usize
pub const MAX_USIZE: usize = 268_435_455usize
The maximum usize value that can be represented as a VBI.
pub const unsafe fn new_unchecked(value: u32) -> Self
pub const unsafe fn new_unchecked(value: u32) -> Self
pub const fn new(value: u32) -> Option<Self>
pub const fn new(value: u32) -> Option<Self>
Creates a new VBI from the given value, returning None if the value is
out of range.
pub const fn encoded_len(self) -> usize
pub const fn encoded_len(self) -> usize
Returns the number of bytes needed to encode this VBI.
Trait Implementations§
§impl Ord for Vbi
impl Ord for Vbi
§impl PartialOrd for Vbi
impl PartialOrd for Vbi
impl Copy for Vbi
impl Eq for Vbi
impl StructuralPartialEq for Vbi
Auto Trait Implementations§
impl Freeze for Vbi
impl RefUnwindSafe for Vbi
impl Send for Vbi
impl Sync for Vbi
impl Unpin for Vbi
impl UnwindSafe for Vbi
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