Struct der::asn1::Utf8StringRef
source · pub struct Utf8StringRef<'a> { /* private fields */ }
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
][prim@str
] primitive, which
decodes/encodes as a Utf8StringRef
.
You are free to use [str
][prim@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§
Trait Implementations§
source§impl AsRef<[u8]> for Utf8StringRef<'_>
impl AsRef<[u8]> for Utf8StringRef<'_>
source§impl AsRef<str> for Utf8StringRef<'_>
impl AsRef<str> for Utf8StringRef<'_>
source§impl<'a> Clone for Utf8StringRef<'a>
impl<'a> Clone for Utf8StringRef<'a>
source§fn clone(&self) -> Utf8StringRef<'a>
fn clone(&self) -> Utf8StringRef<'a>
Returns a copy of the value. Read more
1.0.0§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 Utf8StringRef<'a>
impl<'a> Debug for Utf8StringRef<'a>
source§impl<'a> DecodeValue<'a> for Utf8StringRef<'a>
impl<'a> DecodeValue<'a> for Utf8StringRef<'a>
source§impl<'a> Deref for Utf8StringRef<'a>
impl<'a> Deref for Utf8StringRef<'a>
source§impl<'a> Display for Utf8StringRef<'a>
impl<'a> Display for Utf8StringRef<'a>
source§impl EncodeValue for Utf8StringRef<'_>
impl EncodeValue for Utf8StringRef<'_>
source§impl<'a> From<&Utf8StringRef<'a>> for Utf8StringRef<'a>
impl<'a> From<&Utf8StringRef<'a>> for Utf8StringRef<'a>
source§fn from(value: &Utf8StringRef<'a>) -> Utf8StringRef<'a>
fn from(value: &Utf8StringRef<'a>) -> Utf8StringRef<'a>
Converts to this type from the input type.
source§impl<'a> From<Utf8StringRef<'a>> for AnyRef<'a>
impl<'a> From<Utf8StringRef<'a>> for AnyRef<'a>
source§fn from(printable_string: Utf8StringRef<'a>) -> AnyRef<'a>
fn from(printable_string: Utf8StringRef<'a>) -> AnyRef<'a>
Converts to this type from the input type.
source§impl<'a> From<Utf8StringRef<'a>> for String
impl<'a> From<Utf8StringRef<'a>> for String
source§fn from(s: Utf8StringRef<'a>) -> String
fn from(s: Utf8StringRef<'a>) -> String
Converts to this type from the input type.
source§impl<'a> Ord for Utf8StringRef<'a>
impl<'a> Ord for Utf8StringRef<'a>
source§impl<'a> PartialEq for Utf8StringRef<'a>
impl<'a> PartialEq for Utf8StringRef<'a>
source§impl<'a> PartialOrd for Utf8StringRef<'a>
impl<'a> PartialOrd for Utf8StringRef<'a>
source§fn partial_cmp(&self, other: &Utf8StringRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &Utf8StringRef<'a>) -> Option<Ordering>
source§impl<'a> TryFrom<AnyRef<'a>> for Utf8StringRef<'a>
impl<'a> TryFrom<AnyRef<'a>> for Utf8StringRef<'a>
impl<'a> Copy for Utf8StringRef<'a>
impl<'a> Eq for Utf8StringRef<'a>
impl<'a> StructuralPartialEq for Utf8StringRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for Utf8StringRef<'a>
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§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<'a, T> Choice<'a> for T
impl<'a, T> Choice<'a> for T
source§fn can_decode(tag: Tag) -> bool
fn can_decode(tag: Tag) -> bool
Is the provided
Tag
decodable as a variant of this CHOICE
?§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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 dyn Writer) -> Result<(), Error>
fn encode(&self, writer: &mut dyn 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.
source§fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length>
fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length>
Encode this message as ASN.1 DER, appending it to the provided
byte vector.