Struct ed25519_dalek::pkcs8::spki::der::asn1::OctetStringRef
pub struct OctetStringRef<'a> { /* private fields */ }
Available on crate feature
pkcs8
only.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§
§impl<'a> OctetStringRef<'a>
impl<'a> OctetStringRef<'a>
pub fn new(slice: &'a [u8]) -> Result<OctetStringRef<'a>, Error>
pub fn new(slice: &'a [u8]) -> Result<OctetStringRef<'a>, Error>
Create a new ASN.1 OCTET STRING
from a byte slice.
pub fn decode_into<T>(&self) -> Result<T, Error>where
T: Decode<'a>,
pub fn decode_into<T>(&self) -> Result<T, Error>where
T: Decode<'a>,
Parse T
from this OCTET STRING
’s contents.
Trait Implementations§
§impl AsRef<[u8]> for OctetStringRef<'_>
impl AsRef<[u8]> for OctetStringRef<'_>
§impl<'a> Clone for OctetStringRef<'a>
impl<'a> Clone for OctetStringRef<'a>
§fn clone(&self) -> OctetStringRef<'a>
fn clone(&self) -> OctetStringRef<'a>
Returns a copy 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 more§impl<'a> Debug for OctetStringRef<'a>
impl<'a> Debug for OctetStringRef<'a>
§impl<'a> DecodeValue<'a> for OctetStringRef<'a>
impl<'a> DecodeValue<'a> for OctetStringRef<'a>
§fn decode_value<R>(
reader: &mut R,
header: Header
) -> Result<OctetStringRef<'a>, Error>where
R: Reader<'a>,
fn decode_value<R>(
reader: &mut R,
header: Header
) -> Result<OctetStringRef<'a>, Error>where
R: Reader<'a>,
Attempt to decode this message using the provided
Reader
.§impl EncodeValue for OctetStringRef<'_>
impl EncodeValue for OctetStringRef<'_>
§impl<'a> From<&'a OctetString> for OctetStringRef<'a>
impl<'a> From<&'a OctetString> for OctetStringRef<'a>
§fn from(octet_string: &'a OctetString) -> OctetStringRef<'a>
fn from(octet_string: &'a OctetString) -> OctetStringRef<'a>
Converts to this type from the input type.
§impl<'a> From<&OctetStringRef<'a>> for OctetStringRef<'a>
impl<'a> From<&OctetStringRef<'a>> for OctetStringRef<'a>
§fn from(value: &OctetStringRef<'a>) -> OctetStringRef<'a>
fn from(value: &OctetStringRef<'a>) -> OctetStringRef<'a>
Converts to this type from the input type.
§impl<'a> From<OctetStringRef<'a>> for &'a [u8]
impl<'a> From<OctetStringRef<'a>> for &'a [u8]
§fn from(octet_string: OctetStringRef<'a>) -> &'a [u8] ⓘ
fn from(octet_string: OctetStringRef<'a>) -> &'a [u8] ⓘ
Converts to this type from the input type.
§impl<'a> From<OctetStringRef<'a>> for AnyRef<'a>
impl<'a> From<OctetStringRef<'a>> for AnyRef<'a>
§fn from(octet_string: OctetStringRef<'a>) -> AnyRef<'a>
fn from(octet_string: OctetStringRef<'a>) -> AnyRef<'a>
Converts to this type from the input type.
§impl<'a> Ord for OctetStringRef<'a>
impl<'a> Ord for OctetStringRef<'a>
§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
§impl<'a> PartialEq for OctetStringRef<'a>
impl<'a> PartialEq for OctetStringRef<'a>
§fn eq(&self, other: &OctetStringRef<'a>) -> bool
fn eq(&self, other: &OctetStringRef<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl<'a> PartialOrd for OctetStringRef<'a>
impl<'a> PartialOrd for OctetStringRef<'a>
§fn partial_cmp(&self, other: &OctetStringRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &OctetStringRef<'a>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl<'a> RefToOwned<'a> for OctetStringRef<'a>
impl<'a> RefToOwned<'a> for OctetStringRef<'a>
§type Owned = OctetString
type Owned = OctetString
The resulting type after obtaining ownership.
§fn ref_to_owned(&self) -> <OctetStringRef<'a> as RefToOwned<'a>>::Owned
fn ref_to_owned(&self) -> <OctetStringRef<'a> as RefToOwned<'a>>::Owned
Creates a new object taking ownership of the data
§impl<'__der, 'a> TryFrom<&'__der Any> for OctetStringRef<'a>where
'__der: 'a,
Available on crate feature alloc
only.
impl<'__der, 'a> TryFrom<&'__der Any> for OctetStringRef<'a>where
'__der: 'a,
Available on crate feature
alloc
only.§impl<'__der, 'a> TryFrom<AnyRef<'__der>> for OctetStringRef<'a>where
'__der: 'a,
impl<'__der, 'a> TryFrom<AnyRef<'__der>> for OctetStringRef<'a>where
'__der: 'a,
impl<'a> Copy for OctetStringRef<'a>
impl<'a> Eq for OctetStringRef<'a>
impl<'a> StructuralPartialEq for OctetStringRef<'a>
Auto Trait Implementations§
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
§impl<'a, T> Choice<'a> for T
impl<'a, T> Choice<'a> for T
§fn can_decode(tag: Tag) -> bool
fn can_decode(tag: Tag) -> bool
Is the provided
Tag
decodable as a variant of this CHOICE
?§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
§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.
§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
.
§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this value to the provided byte slice, returning a sub-slice
containing the encoded message.