Trait der::Decodable

source ·
pub trait Decodable<'a>: Sized {
    // Required method
    fn decode(decoder: &mut Decoder<'a>) -> 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.

§Blanket impl for TryFrom<Any>

In almost all cases you do not need to impl this trait yourself, but rather can instead impl TryFrom<Any<'a>, Error = Error> and receive a blanket impl of this trait.

Required Methods§

source

fn decode(decoder: &mut Decoder<'a>) -> 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> Decodable<'a> for Option<T>
where T: Choice<'a>,

source§

fn decode(decoder: &mut Decoder<'a>) -> Result<Option<T>>

Implementors§

source§

impl Decodable<'_> for Tag

source§

impl Decodable<'_> for Header

source§

impl Decodable<'_> for Length

source§

impl<'a> Decodable<'a> for Any<'a>

source§

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

source§

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