pub enum Length {
Definite(usize),
Indefinite,
}Expand description
BER length encoding.
Variants§
Implementations§
Source§impl Length
impl Length
Sourcepub const fn indefinite() -> Self
pub const fn indefinite() -> Self
Create an indefinite length.
Sourcepub fn is_definite(&self) -> bool
pub fn is_definite(&self) -> bool
Check if this is a definite length.
Sourcepub fn is_indefinite(&self) -> bool
pub fn is_indefinite(&self) -> bool
Check if this is an indefinite length.
Sourcepub fn encoded_size(len: usize) -> usize
pub fn encoded_size(len: usize) -> usize
Calculate the encoded size of a length value.
Trait Implementations§
impl Copy for Length
impl Eq for Length
impl StructuralPartialEq for Length
Auto Trait Implementations§
impl Freeze for Length
impl RefUnwindSafe for Length
impl Send for Length
impl Sync for Length
impl Unpin for Length
impl UnsafeUnpin for Length
impl UnwindSafe for Length
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