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

    // Provided method
    fn from_der(bytes: &'a [u8]) -> Result<Self, Error> { ... }
}
Available on crate feature pkcs8 only.
Expand description

Decoding trait.

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

Required Methods§

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

Attempt to decode this message using the provided decoder.

Provided Methods§

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

Parse Self from the provided DER-encoded byte slice.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl<'a> Decode<'a> for Version

§

fn decode<R>(decoder: &mut R) -> Result<Version, Error>
where R: Reader<'a>,

§

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

§

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

§

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

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

§

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

Implementors§

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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