Struct der::Decoder [−][src]
DER decoder.
Implementations
impl<'a> Decoder<'a>[src]
pub fn new(bytes: &'a [u8]) -> Self[src]
Create a new decoder for the given byte slice.
pub fn decode<T: Decodable<'a>>(&mut self) -> Result<T>[src]
Decode a value which impls the Decodable trait.
pub fn error<T>(&mut self, kind: ErrorKind) -> Result<T>[src]
Return an error with the given ErrorKind, annotating it with
context about where the error occurred.
pub fn is_failed(&self) -> bool[src]
Did the decoding operation fail due to an error?
pub fn finish<T>(self, value: T) -> Result<T>[src]
Finish decoding, returning the given value if there is no remaining data, or an error otherwise
pub fn is_finished(&self) -> bool[src]
Have we decoded all of the bytes in this Decoder?
Returns false if we’re not finished decoding or if a fatal error
has occurred.
pub fn any(&mut self) -> Result<Any<'a>>[src]
Attempt to decode an ASN.1 ANY value.
pub fn int8(&mut self) -> Result<i8>[src]
Attempt to decode ASN.1 INTEGER as i8
pub fn int16(&mut self) -> Result<i16>[src]
Attempt to decode ASN.1 INTEGER as i16
pub fn uint8(&mut self) -> Result<u8>[src]
Attempt to decode unsigned ASN.1 INTEGER as u8
pub fn uint16(&mut self) -> Result<u16>[src]
Attempt to decode unsigned ASN.1 INTEGER as u16
pub fn big_uint<N>(&mut self) -> Result<BigUInt<'a, N>> where
N: Unsigned + NonZero, [src]
N: Unsigned + NonZero,
big-uint only.Attempt to decode an ASN.1 INTEGER as a BigUInt.
pub fn bit_string(&mut self) -> Result<BitString<'a>>[src]
Attempt to decode an ASN.1 BIT STRING.
pub fn generalized_time(&mut self) -> Result<GeneralizedTime>[src]
Attempt to decode an ASN.1 GeneralizedTime.
pub fn ia5_string(&mut self) -> Result<Ia5String<'a>>[src]
Attempt to decode an ASN.1 IA5String.
pub fn null(&mut self) -> Result<Null>[src]
Attempt to decode an ASN.1 NULL value.
pub fn octet_string(&mut self) -> Result<OctetString<'a>>[src]
Attempt to decode an ASN.1 OCTET STRING.
pub fn oid(&mut self) -> Result<ObjectIdentifier>[src]
oid only.Attempt to decode an ASN.1 OBJECT IDENTIFIER.
pub fn optional<T: Choice<'a>>(&mut self) -> Result<Option<T>>[src]
Attempt to decode an ASN.1 OPTIONAL value.
pub fn printable_string(&mut self) -> Result<PrintableString<'a>>[src]
Attempt to decode an ASN.1 PrintableString.
pub fn utc_time(&mut self) -> Result<UtcTime>[src]
Attempt to decode an ASN.1 UTCTime.
pub fn utf8_string(&mut self) -> Result<Utf8String<'a>>[src]
Attempt to decode an ASN.1 UTF8String.
pub fn sequence<F, T>(&mut self, f: F) -> Result<T> where
F: FnOnce(&mut Decoder<'a>) -> Result<T>, [src]
F: FnOnce(&mut Decoder<'a>) -> Result<T>,
Attempt to decode an ASN.1 SEQUENCE, creating a new nested
Decoder and calling the provided argument with it.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Decoder<'a>
impl<'a> Send for Decoder<'a>
impl<'a> Sync for Decoder<'a>
impl<'a> Unpin for Decoder<'a>
impl<'a> UnwindSafe for Decoder<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,