Trait rasn::de::Decoder[][src]

pub trait Decoder: Sized {
    type Error: Error;
Show methods 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<D, F>(
        &mut self,
        tag: Tag,
        decode_fn: F
    ) -> Result<D, Self::Error>
    where
        F: FnOnce(&mut Self) -> Result<D, Self::Error>
;
fn decode_sequence_of<D: Decode>(
        &mut self,
        tag: Tag
    ) -> Result<Vec<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>; fn decode_oid<'de>(
        &'de mut self,
        _tag: Tag
    ) -> Result<&'de Oid, Self::Error> { ... }
}
Expand description

A data format decode any ASN.1 data type.

Associated Types

Required methods

Peek at the next available tag.

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

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

Decode a BOOL identified by tag from the available input.

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

Decode a INTEGER identified by tag from the available input.

Decode NULL identified by tag from the available input.

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

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

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

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

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

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

Decode a UtcTime identified by tag from the available input.

Decode a GeneralizedTime identified by tag from the available input.

Provided methods

Decode a OBJECT IDENTIFIER identified by tag from the available input. This is a specialisation of Self::decode_object_identifier for formats where you can zero copy the input.

Implementors