Struct der::Any [−][src]
ASN.1 ANY
: represents any explicitly tagged ASN.1 value.
Technically ANY
hasn’t been a recommended part of ASN.1 since the X.209
revision from 1988. It was deprecated and replaced by Information Object
Classes in X.680 in 1994, and X.690 no longer refers to it whatsoever.
Nevertheless, this crate defines an Any
type as it remains a familiar
and useful concept, although the usage within arguably resembles the
type system concept more than the original ASN.1 concept.
Implementations
impl<'a> Any<'a>
[src]
pub fn new(tag: Tag, value: &'a [u8]) -> Result<Self>
[src]
pub fn tag(self) -> Tag
[src]
Get the tag for this Any
type.
pub fn len(self) -> Length
[src]
pub fn is_empty(self) -> bool
[src]
Is the body of this Any
type empty?
pub fn is_null(self) -> bool
[src]
Is this value an ASN.1 NULL value?
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 generalized_time(self) -> Result<GeneralizedTime>
[src]
Attempt to decode an ASN.1 GeneralizedTime
.
pub fn ia5_string(self) -> Result<Ia5String<'a>>
[src]
Attempt to decode an ASN.1 IA5String
.
pub fn null(self) -> Result<Null>
[src]
Please use the is_null
function instead
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]
oid
only.Attempt to decode an ASN.1 OBJECT IDENTIFIER
.
pub fn printable_string(self) -> Result<PrintableString<'a>>
[src]
Attempt to decode an ASN.1 PrintableString
.
pub fn sequence<F, T>(self, f: F) -> Result<T> where
F: FnOnce(&mut Decoder<'a>) -> Result<T>,
[src]
F: FnOnce(&mut Decoder<'a>) -> Result<T>,
Attempt to decode this value an ASN.1 SEQUENCE
, creating a new
nested Decoder
and calling the provided argument with it.
pub fn utc_time(self) -> Result<UtcTime>
[src]
Attempt to decode an ASN.1 UTCTime
.
pub fn utf8_string(self) -> Result<Utf8String<'a>>
[src]
Attempt to decode an ASN.1 UTF8String
.
Trait Implementations
impl<'a> Choice<'a> for Any<'a>
[src]
fn can_decode(_: Tag) -> bool
[src]
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]
fn decode(decoder: &mut Decoder<'a>) -> Result<Any<'a>>
[src]
fn from_bytes(bytes: &'a [u8]) -> Result<Self>
[src]
impl<'a> Encodable for Any<'a>
[src]
fn encoded_len(&self) -> Result<Length>
[src]
fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>
[src]
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
[src]
fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length>
[src]
fn to_vec(&self) -> Result<Vec<u8>>
[src]
impl<'a> Eq for Any<'a>
[src]
impl<'a> From<()> for Any<'a>
[src]
impl<'a> From<BitString<'a>> for Any<'a>
[src]
impl<'a> From<Ia5String<'a>> for Any<'a>
[src]
impl<'a> From<Null> for Any<'a>
[src]
impl<'a> From<OctetString<'a>> for Any<'a>
[src]
fn from(octet_string: OctetString<'a>) -> Any<'a>
[src]
impl<'a> From<PrintableString<'a>> for Any<'a>
[src]
fn from(printable_string: PrintableString<'a>) -> Any<'a>
[src]
impl<'a> From<Sequence<'a>> for Any<'a>
[src]
impl<'a> From<Utf8String<'a>> for Any<'a>
[src]
fn from(utf8_string: Utf8String<'a>) -> 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.
fn try_from(bytes: &'a [u8]) -> Result<Any<'a>>
[src]
impl TryFrom<Any<'_>> for GeneralizedTime
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(any: Any<'_>) -> Result<GeneralizedTime>
[src]
impl TryFrom<Any<'_>> for Null
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(any: Any<'_>) -> Result<Null>
[src]
impl TryFrom<Any<'_>> for ObjectIdentifier
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(any: Any<'_>) -> Result<ObjectIdentifier>
[src]
impl TryFrom<Any<'_>> for UtcTime
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(any: Any<'_>) -> Result<UtcTime>
[src]
impl<'a, N: BigUIntSize> TryFrom<Any<'a>> for BigUInt<'a, N>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(any: Any<'a>) -> Result<BigUInt<'a, N>>
[src]
impl<'a> TryFrom<Any<'a>> for BitString<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(any: Any<'a>) -> Result<BitString<'a>>
[src]
impl<'a> TryFrom<Any<'a>> for Ia5String<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(any: Any<'a>) -> Result<Ia5String<'a>>
[src]
impl<'a> TryFrom<Any<'a>> for OctetString<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(any: Any<'a>) -> Result<OctetString<'a>>
[src]
impl<'a> TryFrom<Any<'a>> for PrintableString<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(any: Any<'a>) -> Result<PrintableString<'a>>
[src]
impl<'a> TryFrom<Any<'a>> for Sequence<'a>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(any: Any<'a>) -> Result<Sequence<'a>>
[src]
impl<'a> TryFrom<Any<'a>> for Utf8String<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Any<'a>
impl<'a> Send for Any<'a>
impl<'a> Sync for Any<'a>
impl<'a> Unpin for Any<'a>
impl<'a> UnwindSafe for Any<'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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,