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.

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>>

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 Length

source§

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

source§

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