pub struct Any { /* private fields */ }Available on crate feature
alloc only.Expand description
ASN.1 ANY: represents any explicitly tagged ASN.1 value.
This type provides the same functionality as AnyRef but owns the
backing data.
Implementations§
Source§impl Any
impl Any
Sourcepub fn decode_as<'a, T>(&'a self) -> Result<T, <T as DecodeValue<'a>>::Error>where
T: Choice<'a> + DecodeValue<'a>,
pub fn decode_as<'a, T>(&'a self) -> Result<T, <T as DecodeValue<'a>>::Error>where
T: Choice<'a> + DecodeValue<'a>,
Sourcepub fn decode_as_encoding<'a, T>(
&'a self,
encoding: EncodingRules,
) -> Result<T, <T as DecodeValue<'a>>::Error>where
T: Choice<'a> + DecodeValue<'a>,
pub fn decode_as_encoding<'a, T>(
&'a self,
encoding: EncodingRules,
) -> Result<T, <T as DecodeValue<'a>>::Error>where
T: Choice<'a> + DecodeValue<'a>,
Sourcepub fn encode_from<T>(msg: &T) -> Result<Self, Error>where
T: Tagged + EncodeValue,
pub fn encode_from<T>(msg: &T) -> Result<Self, Error>where
T: Tagged + EncodeValue,
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for Any
impl<'arbitrary> Arbitrary<'arbitrary> for Any
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§impl<'a> Decode<'a> for Any
impl<'a> Decode<'a> for Any
Source§fn decode<R: Reader<'a>>(reader: &mut R) -> Result<Self, Error>
fn decode<R: Reader<'a>>(reader: &mut R) -> Result<Self, Error>
Attempt to decode this TLV message using the provided decoder. Read more
Source§fn from_ber(bytes: &'a [u8]) -> Result<Self, Self::Error>
fn from_ber(bytes: &'a [u8]) -> Result<Self, Self::Error>
Available on crate feature
ber only.Parse
Self from the provided BER-encoded byte slice. Read moreSource§impl<'a> DecodeValue<'a> for Any
impl<'a> DecodeValue<'a> for Any
Source§impl EncodeValue for Any
impl EncodeValue for Any
Source§impl From<&BitStringRef<'_>> for Any
impl From<&BitStringRef<'_>> for Any
Source§fn from(bit_string_ref: &BitStringRef<'_>) -> Any
fn from(bit_string_ref: &BitStringRef<'_>) -> Any
Converts to this type from the input type.
Source§impl From<BitStringRef<'_>> for Any
impl From<BitStringRef<'_>> for Any
Source§fn from(bit_string_ref: BitStringRef<'_>) -> Any
fn from(bit_string_ref: BitStringRef<'_>) -> Any
Converts to this type from the input type.
Source§impl<const MAX_SIZE: usize> From<ObjectIdentifier<MAX_SIZE>> for Any
Available on crate feature oid only.
impl<const MAX_SIZE: usize> From<ObjectIdentifier<MAX_SIZE>> for Any
Available on crate feature
oid only.Source§fn from(oid: ObjectIdentifier<MAX_SIZE>) -> Any
fn from(oid: ObjectIdentifier<MAX_SIZE>) -> Any
Converts to this type from the input type.
Source§impl Ord for Any
impl Ord for Any
Source§impl OwnedToRef for Any
impl OwnedToRef for Any
Source§impl PartialOrd for Any
impl PartialOrd for Any
Source§impl<'__der: 'a, 'a> TryFrom<&'__der Any> for &'a OctetStringRef
impl<'__der: 'a, 'a> TryFrom<&'__der Any> for &'a OctetStringRef
Source§impl<'__der: 'a, 'a> TryFrom<&'__der Any> for BitStringRef<'a>
impl<'__der: 'a, 'a> TryFrom<&'__der Any> for BitStringRef<'a>
Source§impl<'__der> TryFrom<&'__der Any> for GeneralizedTime
impl<'__der> TryFrom<&'__der Any> for GeneralizedTime
Source§impl<'__der: 'a, 'a> TryFrom<&'__der Any> for Ia5StringRef<'a>
impl<'__der: 'a, 'a> TryFrom<&'__der Any> for Ia5StringRef<'a>
Source§impl<'__der> TryFrom<&'__der Any> for OctetString
impl<'__der> TryFrom<&'__der Any> for OctetString
Source§impl<'__der> TryFrom<&'__der Any> for PrintableString
impl<'__der> TryFrom<&'__der Any> for PrintableString
Source§impl<'__der: 'a, 'a> TryFrom<&'__der Any> for PrintableStringRef<'a>
impl<'__der: 'a, 'a> TryFrom<&'__der Any> for PrintableStringRef<'a>
Source§impl<'__der> TryFrom<&'__der Any> for TeletexString
impl<'__der> TryFrom<&'__der Any> for TeletexString
Source§impl<'__der: 'a, 'a> TryFrom<&'__der Any> for TeletexStringRef<'a>
impl<'__der: 'a, 'a> TryFrom<&'__der Any> for TeletexStringRef<'a>
Source§impl<'__der: 'a, 'a> TryFrom<&'__der Any> for Utf8StringRef<'a>
impl<'__der: 'a, 'a> TryFrom<&'__der Any> for Utf8StringRef<'a>
Source§impl<'__der: 'a, 'a> TryFrom<&'__der Any> for VideotexStringRef<'a>
impl<'__der: 'a, 'a> TryFrom<&'__der Any> for VideotexStringRef<'a>
impl Eq for Any
impl StructuralPartialEq for Any
Auto Trait Implementations§
impl Freeze for Any
impl RefUnwindSafe for Any
impl Send for Any
impl Sync for Any
impl Unpin for Any
impl UnwindSafe for Any
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Encode for T
impl<T> Encode for T
Source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this TLV object in bytes when encoded as ASN.1 DER. Read more
Source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
Encode this TLV object to the provided byte slice, returning a sub-slice
containing the encoded message. Read more