Struct NonZeroVbi
pub struct NonZeroVbi(NonZero<u32>);Expand description
Non-zero Variable Byte Integer.
Tuple Fields§
§0: NonZero<u32>Implementations§
Source§impl NonZeroVbi
impl NonZeroVbi
Sourcepub const MAX: NonZeroVbi
pub const MAX: NonZeroVbi
The maximum value.
Sourcepub const fn new(value: u32) -> Option<NonZeroVbi>
pub const fn new(value: u32) -> Option<NonZeroVbi>
Creates a new non-zero VBI, returning None if the value is zero.
Sourcepub const fn from_vbi(value: Vbi) -> Option<NonZeroVbi>
pub const fn from_vbi(value: Vbi) -> Option<NonZeroVbi>
Creates a new non-zero VBI, returning None if the value is zero.
Sourcepub 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§
Source§impl Clone for NonZeroVbi
impl Clone for NonZeroVbi
Source§fn clone(&self) -> NonZeroVbi
fn clone(&self) -> NonZeroVbi
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NonZeroVbi
impl Debug for NonZeroVbi
Source§impl Hash for NonZeroVbi
impl Hash for NonZeroVbi
Source§impl Ord for NonZeroVbi
impl Ord for NonZeroVbi
Source§fn cmp(&self, other: &NonZeroVbi) -> Ordering
fn cmp(&self, other: &NonZeroVbi) -> Ordering
1.21.0 · 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
Source§impl PartialEq for NonZeroVbi
impl PartialEq for NonZeroVbi
Source§impl PartialOrd for NonZeroVbi
impl PartialOrd for NonZeroVbi
impl Copy for NonZeroVbi
impl Eq 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more