[][src]Struct der::Any

pub struct Any<'a> { /* fields omitted */ }

ASN.1 ANY type: represents any explicitly tagged ASN.1 value.

Implementations

impl<'a> Any<'a>[src]

pub fn new(tag: Tag, value: &'a [u8]) -> Result<Self>[src]

Create a new Any from the provided Tag and slice.

pub fn tag(self) -> Tag[src]

Get the tag for this Any type.

pub fn len(self) -> Length[src]

Get the Length of this Any type's value.

pub fn is_empty(self) -> bool[src]

Is the value of this Any type empty?

pub fn as_bytes(self) -> &'a [u8][src]

Get the raw value for this Any type as a byte slice

pub fn bit_string(self) -> Result<BitString<'a>>[src]

Attempt to decode an ASN.1 BIT STRING

pub fn null(self) -> Result<Null>[src]

Attempt to decode an ASN.1 NULL value

pub fn octet_string(self) -> Result<OctetString<'a>>[src]

Attempt to decode an ASN.1 OCTET STRING

pub fn oid(self) -> Result<ObjectIdentifier>[src]

This is supported on crate feature oid only.

Attempt to decode an ASN.1 OBJECT IDENTIFIER

pub fn sequence<F, T>(self, f: F) -> Result<T> where
    F: FnOnce(&mut Decoder<'a>) -> Result<T>, 
[src]

Attempt to decode this value an ASN.1 SEQUENCE, creating a new nested Decoder and calling the provided argument with it.

Trait Implementations

impl<'a> Clone for Any<'a>[src]

impl<'a> Copy for Any<'a>[src]

impl<'a> Debug for Any<'a>[src]

impl<'a> Decodable<'a> for Any<'a>[src]

impl<'a> Encodable for Any<'a>[src]

impl<'a> Eq for Any<'a>[src]

impl<'a> From<BitString<'a>> for Any<'a>[src]

impl<'a> From<Null> for Any<'a>[src]

impl<'a> From<OctetString<'a>> for Any<'a>[src]

impl<'a> From<RawInteger<'a>> for Any<'a>[src]

impl<'a> From<Sequence<'a>> for Any<'a>[src]

impl<'a> PartialEq<Any<'a>> for Any<'a>[src]

impl<'a> StructuralEq for Any<'a>[src]

impl<'a> StructuralPartialEq for Any<'a>[src]

impl<'a> TryFrom<&'a [u8]> for Any<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'_> TryFrom<Any<'_>> for bool[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'_> TryFrom<Any<'_>> for i8[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'_> TryFrom<Any<'_>> for Null[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'_> TryFrom<Any<'_>> for ObjectIdentifier[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<Any<'a>> for BitString<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<Any<'a>> for RawInteger<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<Any<'a>> for OctetString<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<Any<'a>> for Sequence<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Any<'a>[src]

impl<'a> Send for Any<'a>[src]

impl<'a> Sync for Any<'a>[src]

impl<'a> Unpin for Any<'a>[src]

impl<'a> UnwindSafe for Any<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.