Trait der::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.

Object Safety§

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,