pub struct OctetStringRef<'a> { /* private fields */ }
Expand description
ASN.1 OCTET STRING
type: borrowed form.
Octet strings represent contiguous sequences of octets, a.k.a. bytes.
This is a zero-copy reference type which borrows from the input data.
Implementations§
Source§impl<'a> OctetStringRef<'a>
impl<'a> OctetStringRef<'a>
Sourcepub fn decode_into<T: Decode<'a>>(&self) -> Result<T>
pub fn decode_into<T: Decode<'a>>(&self) -> Result<T>
Parse T
from this OCTET STRING
’s contents.
Trait Implementations§
Source§impl AsRef<[u8]> for OctetStringRef<'_>
impl AsRef<[u8]> for OctetStringRef<'_>
Source§impl<'a> Clone for OctetStringRef<'a>
impl<'a> Clone for OctetStringRef<'a>
Source§fn clone(&self) -> OctetStringRef<'a>
fn clone(&self) -> OctetStringRef<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for OctetStringRef<'a>
impl<'a> Debug for OctetStringRef<'a>
Source§impl<'a> DecodeValue<'a> for OctetStringRef<'a>
impl<'a> DecodeValue<'a> for OctetStringRef<'a>
Source§impl EncodeValue for OctetStringRef<'_>
impl EncodeValue for OctetStringRef<'_>
Source§impl<'a> From<&'a OctetString> for OctetStringRef<'a>
Available on crate feature alloc
only.
impl<'a> From<&'a OctetString> for OctetStringRef<'a>
Available on crate feature
alloc
only.Source§fn from(octet_string: &'a OctetString) -> OctetStringRef<'a>
fn from(octet_string: &'a OctetString) -> OctetStringRef<'a>
Converts to this type from the input type.
Source§impl<'a> From<&OctetStringRef<'a>> for OctetStringRef<'a>
impl<'a> From<&OctetStringRef<'a>> for OctetStringRef<'a>
Source§fn from(value: &OctetStringRef<'a>) -> OctetStringRef<'a>
fn from(value: &OctetStringRef<'a>) -> OctetStringRef<'a>
Converts to this type from the input type.
Source§impl<'a> From<OctetStringRef<'a>> for &'a [u8]
impl<'a> From<OctetStringRef<'a>> for &'a [u8]
Source§impl<'a> From<OctetStringRef<'a>> for AnyRef<'a>
impl<'a> From<OctetStringRef<'a>> for AnyRef<'a>
Source§fn from(octet_string: OctetStringRef<'a>) -> AnyRef<'a>
fn from(octet_string: OctetStringRef<'a>) -> AnyRef<'a>
Converts to this type from the input type.
Source§impl<'a> Ord for OctetStringRef<'a>
impl<'a> Ord for OctetStringRef<'a>
Source§fn cmp(&self, other: &OctetStringRef<'a>) -> Ordering
fn cmp(&self, other: &OctetStringRef<'a>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialEq for OctetStringRef<'a>
impl<'a> PartialEq for OctetStringRef<'a>
Source§impl<'a> PartialOrd for OctetStringRef<'a>
impl<'a> PartialOrd for OctetStringRef<'a>
Source§impl<'a> RefToOwned<'a> for OctetStringRef<'a>
Available on crate feature alloc
only.
impl<'a> RefToOwned<'a> for OctetStringRef<'a>
Available on crate feature
alloc
only.Source§type Owned = OctetString
type Owned = OctetString
The resulting type after obtaining ownership.
Source§fn ref_to_owned(&self) -> Self::Owned
fn ref_to_owned(&self) -> Self::Owned
Creates a new object taking ownership of the data
Source§impl<'__der: 'a, 'a> TryFrom<&'__der Any> for OctetStringRef<'a>
Available on crate feature alloc
only.
impl<'__der: 'a, 'a> TryFrom<&'__der Any> for OctetStringRef<'a>
Available on crate feature
alloc
only.Source§impl<'__der: 'a, 'a> TryFrom<AnyRef<'__der>> for OctetStringRef<'a>
impl<'__der: 'a, 'a> TryFrom<AnyRef<'__der>> for OctetStringRef<'a>
impl<'a> Copy for OctetStringRef<'a>
impl<'a> Eq for OctetStringRef<'a>
impl<'a> StructuralPartialEq for OctetStringRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for OctetStringRef<'a>
impl<'a> RefUnwindSafe for OctetStringRef<'a>
impl<'a> Send for OctetStringRef<'a>
impl<'a> Sync for OctetStringRef<'a>
impl<'a> Unpin for OctetStringRef<'a>
impl<'a> UnwindSafe for OctetStringRef<'a>
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<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
Source§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
Source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
Source§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer
.
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 value to the provided byte slice, returning a sub-slice
containing the encoded message.
impl<T> DecodeOwned for Twhere
T: for<'a> Decode<'a>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes