der

Trait Decode

Source
pub trait Decode<'a>: Sized {
    // Required method
    fn decode<R: Reader<'a>>(decoder: &mut R) -> Result<Self>;

    // Provided method
    fn from_der(bytes: &'a [u8]) -> Result<Self> { ... }
}
Expand description

Decoding trait.

This trait provides the core abstraction upon which all decoding operations are based.

Required Methods§

Source

fn decode<R: Reader<'a>>(decoder: &mut R) -> Result<Self>

Attempt to decode this message using the provided decoder.

Provided Methods§

Source

fn from_der(bytes: &'a [u8]) -> Result<Self>

Parse Self from the provided DER-encoded byte slice.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T> Decode<'a> for Option<T>
where T: Choice<'a>,

Source§

fn decode<R: Reader<'a>>(reader: &mut R) -> Result<Option<T>>

Source§

impl<'a, T> Decode<'a> for PhantomData<T>
where T: ?Sized,

Dummy implementation for PhantomData which allows deriving implementations on structs with phantom fields.

Source§

fn decode<R: Reader<'a>>(_reader: &mut R) -> Result<PhantomData<T>>

Implementors§

Source§

impl<'a> Decode<'a> for Tag

Source§

impl<'a> Decode<'a> for Any

Source§

impl<'a> Decode<'a> for AnyRef<'a>

Source§

impl<'a> Decode<'a> for Document

Source§

impl<'a> Decode<'a> for Header

Source§

impl<'a> Decode<'a> for IndefiniteLength

Source§

impl<'a> Decode<'a> for Length

Source§

impl<'a, T> Decode<'a> for ContextSpecific<T>
where T: Decode<'a>,

Source§

impl<'a, T> Decode<'a> for T
where T: DecodeValue<'a> + FixedTag,