Trait rasn::de::Decode

source ·
pub trait Decode: Sized + AsnType {
    // Required method
    fn decode_with_tag_and_constraints<D: Decoder>(
        decoder: &mut D,
        tag: Tag,
        constraints: Constraints<'_>
    ) -> Result<Self, D::Error>;

    // Provided methods
    fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, D::Error> { ... }
    fn decode_with_tag<D: Decoder>(
        decoder: &mut D,
        tag: Tag
    ) -> Result<Self, D::Error> { ... }
    fn decode_with_constraints<D: Decoder>(
        decoder: &mut D,
        constraints: Constraints<'_>
    ) -> Result<Self, D::Error> { ... }
}
Expand description

A data type that can decoded from any ASN.1 format.

Required Methods§

source

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

Provided Methods§

source

fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, D::Error>

Decode this value from a given ASN.1 decoder.

Note for implementors You typically do not need to implement this. The default implementation will call Decode::decode_with_tag with your types associated AsnType::TAG. You should only ever need to implement this if you have a type that cannot be implicitly tagged, such as a CHOICE type, which case you want to implement the decoding in decode.

source

fn decode_with_tag<D: Decoder>( decoder: &mut D, tag: Tag ) -> Result<Self, D::Error>

Decode this value implicitly tagged with tag from a given ASN.1 decoder.

Note For CHOICE and other types that cannot be implicitly tagged this will explicitly tag the value, for all other types, it will implicitly tag the value.

source

fn decode_with_constraints<D: Decoder>( decoder: &mut D, constraints: Constraints<'_> ) -> Result<Self, D::Error>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Decode for bool

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, _: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl Decode for i8

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl Decode for i16

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl Decode for i32

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl Decode for i64

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl Decode for isize

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl Decode for u8

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl Decode for u16

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl Decode for u32

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl Decode for u64

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl Decode for ()

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, _: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl Decode for usize

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl<D: Decode> Decode for Option<D>

source§

fn decode<DE: Decoder>(decoder: &mut DE) -> Result<Self, DE::Error>

source§

fn decode_with_tag<DE: Decoder>( decoder: &mut DE, tag: Tag ) -> Result<Self, DE::Error>

source§

fn decode_with_constraints<DE: Decoder>( decoder: &mut DE, constraints: Constraints<'_> ) -> Result<Self, DE::Error>

source§

fn decode_with_tag_and_constraints<DE: Decoder>( decoder: &mut DE, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, DE::Error>

source§

impl<T: Decode + Ord> Decode for BTreeSet<T>

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl<T: Decode + Default, const N: usize> Decode for [T; N]

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

source§

impl<T: Decode> Decode for Box<T>

source§

fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, D::Error>

source§

fn decode_with_tag<D: Decoder>( decoder: &mut D, tag: Tag ) -> Result<Self, D::Error>

source§

fn decode_with_constraints<DE: Decoder>( decoder: &mut DE, constraints: Constraints<'_> ) -> Result<Self, DE::Error>

source§

fn decode_with_tag_and_constraints<DE: Decoder>( decoder: &mut DE, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, DE::Error>

source§

impl<T: Decode> Decode for Vec<T>

source§

fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints<'_> ) -> Result<Self, D::Error>

Implementors§