Struct der::Length[][src]

pub struct Length(_);

ASN.1-encoded length.

Limits

Presently constrained to the range 0..=65535

Implementations

impl Length[src]

pub const fn new(value: u16) -> Self[src]

Create a new Length for any value which fits inside of a u16.

This function is const-safe and therefore useful for Length constants.

pub const fn zero() -> Self[src]

Return a length of 0.

pub const fn one() -> Self[src]

Return a length of 1.

pub const fn max() -> Self[src]

Get the maximum length supported by this crate

pub fn for_tlv(self) -> Result<Self>[src]

Get the length of DER Tag-Length-Value (TLV) encoded data if self is the length of the inner “value” portion of the message

Trait Implementations

impl Add<Length> for Length[src]

type Output = Result<Self>

The resulting type after applying the + operator.

impl Add<Length> for Result<Length>[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<u16> for Length[src]

type Output = Result<Self>

The resulting type after applying the + operator.

impl Add<u32> for Length[src]

type Output = Result<Self>

The resulting type after applying the + operator.

impl Add<u8> for Length[src]

type Output = Result<Self>

The resulting type after applying the + operator.

impl Add<usize> for Length[src]

type Output = Result<Self>

The resulting type after applying the + operator.

impl Clone for Length[src]

impl Copy for Length[src]

impl Debug for Length[src]

impl Decodable<'_> for Length[src]

impl Default for Length[src]

impl Display for Length[src]

impl Encodable for Length[src]

impl Eq for Length[src]

impl From<u16> for Length[src]

impl From<u8> for Length[src]

impl Ord for Length[src]

impl PartialEq<Length> for Length[src]

impl PartialOrd<Length> for Length[src]

impl StructuralEq for Length[src]

impl StructuralPartialEq for Length[src]

impl TryFrom<u32> for Length[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<usize> for Length[src]

type Error = Error

The type returned in the event of a conversion error.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.