pub struct Length(/* private fields */);
Expand description
BER-TLV-encoded length.
By definition, in the range 0..=65535
The length field consists of one or three consecutive bytes.
- If the first byte is not
0xFF
, then the length field consists of a single byte encoding a number from zero to 254. - If the first byte is
0xFF
, then the length field consists of the subsequent two bytes interpreted as big-endian integer, with any value from zero to 65,535.
Implementations§
Trait Implementations§
source§impl Encodable for Length
impl Encodable for Length
source§impl Ord for Length
impl Ord for Length
source§impl PartialEq for Length
impl PartialEq for Length
source§impl PartialOrd for Length
impl PartialOrd for Length
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<'a> TryFrom<&'a [&'a dyn Encodable]> for Length
impl<'a> TryFrom<&'a [&'a dyn Encodable]> for Length
Calculate the sum of the encoded lengths of the encodables.
impl Copy for Length
impl Eq for Length
impl StructuralEq for Length
impl StructuralPartialEq for Length
Auto Trait Implementations§
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