Struct NonZeroVbi
pub struct NonZeroVbi(NonZeroU32);Expand description
Non-zero Variable Byte Integer.
Tuple Fields§
§0: NonZeroU32Implementations§
§impl NonZeroVbi
impl NonZeroVbi
pub const MAX: Self
pub const MAX: Self
The maximum value.
pub const fn new(value: u32) -> Option<Self>
pub const fn new(value: u32) -> Option<Self>
Creates a new non-zero VBI. Returns None if the value is zero or
above Vbi::MAX.
pub const fn from_vbi(value: Vbi) -> Option<Self>
pub const fn from_vbi(value: Vbi) -> Option<Self>
Creates a new non-zero VBI, returning None if the value is zero.
pub const fn encoded_len(self) -> usize
pub const fn encoded_len(self) -> usize
Returns the number of bytes needed to encode this non-zero VBI.
Trait Implementations§
§impl Clone for NonZeroVbi
impl Clone for NonZeroVbi
§fn clone(&self) -> NonZeroVbi
fn clone(&self) -> NonZeroVbi
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for NonZeroVbi
§impl Debug for NonZeroVbi
impl Debug for NonZeroVbi
impl Eq for NonZeroVbi
§impl Hash for NonZeroVbi
impl Hash for NonZeroVbi
§impl Ord for NonZeroVbi
impl Ord for NonZeroVbi
§fn cmp(&self, other: &NonZeroVbi) -> Ordering
fn cmp(&self, other: &NonZeroVbi) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
§impl PartialEq for NonZeroVbi
impl PartialEq for NonZeroVbi
§impl PartialOrd for NonZeroVbi
impl PartialOrd for NonZeroVbi
impl StructuralPartialEq for NonZeroVbi
Auto Trait Implementations§
impl Freeze for NonZeroVbi
impl RefUnwindSafe for NonZeroVbi
impl Send for NonZeroVbi
impl Sync for NonZeroVbi
impl Unpin for NonZeroVbi
impl UnsafeUnpin for NonZeroVbi
impl UnwindSafe for NonZeroVbi
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