pub enum Length {
Standard(u16),
Extended {
upper: u8,
lower: u16,
},
}
Variants§
Implementations§
Source§impl Length
impl Length
pub const EXTENDED_LENGTH_THRESHOLD: usize = 4_096usize
pub fn new(length: usize, flags: Flags) -> Self
pub fn new_standard_from_u16(length: u16) -> Self
pub fn new_extended_from_u32(length: u32) -> Self
pub fn size(&self) -> usize
pub fn as_u32(&self) -> u32
pub fn as_usize(&self) -> usize
pub fn encode(&self, buf: &mut [u8]) -> Result<usize, AcnError>
pub fn decode(buf: &[u8]) -> Result<Self, AcnError>
Trait Implementations§
Source§impl Ord for Length
impl Ord for Length
Source§impl PartialOrd for Length
impl PartialOrd for Length
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 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