Struct ed25519_dalek::pkcs8::spki::der::asn1::Utf8StringRef
pub struct Utf8StringRef<'a> { /* private fields */ }
Available on crate feature
pkcs8
only.Expand description
ASN.1 UTF8String
type.
Supports the full UTF-8 encoding.
Note that the Decode
and Encode
traits are impl’d for Rust’s str
primitive, which
decodes/encodes as a Utf8StringRef
.
You are free to use str
instead of this type, however it’s
still provided for explicitness in cases where it might be ambiguous with
other ASN.1 string encodings such as
PrintableStringRef
.
This is a zero-copy reference type which borrows from the input data.
Implementations§
§impl<'a> Utf8StringRef<'a>
impl<'a> Utf8StringRef<'a>
Trait Implementations§
§impl<'a> AsRef<[u8]> for Utf8StringRef<'a>
impl<'a> AsRef<[u8]> for Utf8StringRef<'a>
§impl<'a> AsRef<str> for Utf8StringRef<'a>
impl<'a> AsRef<str> for Utf8StringRef<'a>
§impl<'a> Clone for Utf8StringRef<'a>
impl<'a> Clone for Utf8StringRef<'a>
§fn clone(&self) -> Utf8StringRef<'a>
fn clone(&self) -> Utf8StringRef<'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 Utf8StringRef<'a>
impl<'a> Debug for Utf8StringRef<'a>
§impl<'__der, 'a> DecodeValue<'__der> for Utf8StringRef<'a>where
'__der: 'a,
impl<'__der, 'a> DecodeValue<'__der> for Utf8StringRef<'a>where
'__der: 'a,
§fn decode_value<R>(
reader: &mut R,
header: Header
) -> Result<Utf8StringRef<'a>, Error>where
R: Reader<'__der>,
fn decode_value<R>(
reader: &mut R,
header: Header
) -> Result<Utf8StringRef<'a>, Error>where
R: Reader<'__der>,
Attempt to decode this message using the provided
Reader
.§impl<'a> Deref for Utf8StringRef<'a>
impl<'a> Deref for Utf8StringRef<'a>
§impl<'a> Display for Utf8StringRef<'a>
impl<'a> Display for Utf8StringRef<'a>
§impl<'a> EncodeValue for Utf8StringRef<'a>
impl<'a> EncodeValue for Utf8StringRef<'a>
§impl<'a> From<&Utf8StringRef<'a>> for Utf8StringRef<'a>
impl<'a> From<&Utf8StringRef<'a>> for Utf8StringRef<'a>
§fn from(value: &Utf8StringRef<'a>) -> Utf8StringRef<'a>
fn from(value: &Utf8StringRef<'a>) -> Utf8StringRef<'a>
Converts to this type from the input type.
§impl<'a> From<Utf8StringRef<'a>> for AnyRef<'a>
impl<'a> From<Utf8StringRef<'a>> for AnyRef<'a>
§fn from(utf_string: Utf8StringRef<'a>) -> AnyRef<'a>
fn from(utf_string: Utf8StringRef<'a>) -> AnyRef<'a>
Converts to this type from the input type.
§impl<'a> Ord for Utf8StringRef<'a>
impl<'a> Ord for Utf8StringRef<'a>
§fn cmp(&self, other: &Utf8StringRef<'a>) -> Ordering
fn cmp(&self, other: &Utf8StringRef<'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 Utf8StringRef<'a>
impl<'a> PartialEq for Utf8StringRef<'a>
§fn eq(&self, other: &Utf8StringRef<'a>) -> bool
fn eq(&self, other: &Utf8StringRef<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl<'a> PartialOrd for Utf8StringRef<'a>
impl<'a> PartialOrd for Utf8StringRef<'a>
§fn partial_cmp(&self, other: &Utf8StringRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &Utf8StringRef<'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<'__der, 'a> TryFrom<&'__der Any> for Utf8StringRef<'a>where
'__der: 'a,
Available on crate feature alloc
only.
impl<'__der, 'a> TryFrom<&'__der Any> for Utf8StringRef<'a>where
'__der: 'a,
Available on crate feature
alloc
only.§impl<'__der, 'a> TryFrom<AnyRef<'__der>> for Utf8StringRef<'a>where
'__der: 'a,
impl<'__der, 'a> TryFrom<AnyRef<'__der>> for Utf8StringRef<'a>where
'__der: 'a,
impl<'a> Copy for Utf8StringRef<'a>
impl<'a> Eq for Utf8StringRef<'a>
impl<'a> StructuralPartialEq for Utf8StringRef<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Utf8StringRef<'a>
impl<'a> Send for Utf8StringRef<'a>
impl<'a> Sync for Utf8StringRef<'a>
impl<'a> Unpin for Utf8StringRef<'a>
impl<'a> UnwindSafe for Utf8StringRef<'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.