Trait rasn::Decoder[][src]

pub trait Decoder: Sized {
    type Error: Error;
    fn peek_tag(&self) -> Result<Tag, Self::Error>;
fn decode_any(&mut self, tag: Tag) -> Result<Vec<u8>, Self::Error>;
fn decode_bit_string(&mut self, tag: Tag) -> Result<BitString, Self::Error>;
fn decode_bool(&mut self, tag: Tag) -> Result<bool, Self::Error>;
fn decode_enumerated(&mut self, tag: Tag) -> Result<Integer, Self::Error>;
fn decode_integer(&mut self, tag: Tag) -> Result<Integer, Self::Error>;
fn decode_null(&mut self, tag: Tag) -> Result<(), Self::Error>;
fn decode_object_identifier(
        &mut self,
        tag: Tag
    ) -> Result<ObjectIdentifier, Self::Error>;
fn decode_sequence(&mut self, tag: Tag) -> Result<Self, Self::Error>;
fn decode_sequence_of<D: Decode>(
        &mut self,
        tag: Tag
    ) -> Result<Vec<D>, Self::Error>;
fn decode_set(&mut self, tag: Tag) -> Result<Self, Self::Error>;
fn decode_set_of<D: Decode + Ord>(
        &mut self,
        tag: Tag
    ) -> Result<BTreeSet<D>, Self::Error>;
fn decode_octet_string(&mut self, tag: Tag) -> Result<Vec<u8>, Self::Error>;
fn decode_utf8_string(
        &mut self,
        tag: Tag
    ) -> Result<Utf8String, Self::Error>;
fn decode_explicit_prefix<D: Decode>(
        &mut self,
        tag: Tag
    ) -> Result<D, Self::Error>;
fn decode_utc_time(&mut self, tag: Tag) -> Result<UtcTime, Self::Error>;
fn decode_generalized_time(
        &mut self,
        tag: Tag
    ) -> Result<GeneralizedTime, Self::Error>; }

A data format decode any ASN.1 data type.

Associated Types

Loading content...

Required methods

fn peek_tag(&self) -> Result<Tag, Self::Error>[src]

Peek at the next available tag.

fn decode_any(&mut self, tag: Tag) -> Result<Vec<u8>, Self::Error>[src]

Decode a unknown ASN.1 value identified by tag from the available input.

fn decode_bit_string(&mut self, tag: Tag) -> Result<BitString, Self::Error>[src]

Decode a BIT STRING identified by tag from the available input.

fn decode_bool(&mut self, tag: Tag) -> Result<bool, Self::Error>[src]

Decode a BOOL identified by tag from the available input.

fn decode_enumerated(&mut self, tag: Tag) -> Result<Integer, Self::Error>[src]

Decode an enumerated enum’s discriminant identified by tag from the available input.

fn decode_integer(&mut self, tag: Tag) -> Result<Integer, Self::Error>[src]

Decode a INTEGER identified by tag from the available input.

fn decode_null(&mut self, tag: Tag) -> Result<(), Self::Error>[src]

Decode NULL identified by tag from the available input.

fn decode_object_identifier(
    &mut self,
    tag: Tag
) -> Result<ObjectIdentifier, Self::Error>
[src]

Decode a OBJECT IDENTIFIER identified by tag from the available input.

fn decode_sequence(&mut self, tag: Tag) -> Result<Self, Self::Error>[src]

Decode a SEQUENCE identified by tag from the available input. Returning a new Decoder containing the sequence’s contents to be decoded.

fn decode_sequence_of<D: Decode>(
    &mut self,
    tag: Tag
) -> Result<Vec<D>, Self::Error>
[src]

Decode a SEQUENCE OF D where D: Decode identified by tag from the available input.

fn decode_set(&mut self, tag: Tag) -> Result<Self, Self::Error>[src]

Decode a SET identified by tag from the available input. Returning a new Decoder containing the sequence’s contents to be decoded.

fn decode_set_of<D: Decode + Ord>(
    &mut self,
    tag: Tag
) -> Result<BTreeSet<D>, Self::Error>
[src]

Decode a SET OF D where D: Decode identified by tag from the available input.

fn decode_octet_string(&mut self, tag: Tag) -> Result<Vec<u8>, Self::Error>[src]

Decode a OCTET STRING identified by tag from the available input.

fn decode_utf8_string(&mut self, tag: Tag) -> Result<Utf8String, Self::Error>[src]

Decode a UTF8 STRING identified by tag from the available input.

fn decode_explicit_prefix<D: Decode>(
    &mut self,
    tag: Tag
) -> Result<D, Self::Error>
[src]

Decode an ASN.1 value that has been explicitly prefixed with tag from the available input.

fn decode_utc_time(&mut self, tag: Tag) -> Result<UtcTime, Self::Error>[src]

Decode a UtcTime identified by tag from the available input.

fn decode_generalized_time(
    &mut self,
    tag: Tag
) -> Result<GeneralizedTime, Self::Error>
[src]

Decode a GeneralizedTime identified by tag from the available input.

Loading content...

Implementors

impl<'input> Decoder for Decoder<'input>[src]

type Error = Error

Loading content...