Struct der::Utf8String [−][src]
ASN.1 UTF8String
type.
Supports the full UTF-8 encoding.
Note that the Decodable
and Encodable
traits
are impl'd for Rust's str
primitive, which decodes/encodes
as a Utf8String
.
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
PrintableString
.
Implementations
impl<'a> Utf8String<'a>
[src]
pub fn new<T: ?Sized>(input: &'a T) -> Result<Self> where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
Create a new Utf8String
.
pub fn as_str(&self) -> &'a str
[src]
Borrow the string as a str
.
pub fn as_bytes(&self) -> &'a [u8]
[src]
Borrow the string as bytes.
pub fn len(&self) -> Length
[src]
Get the length of the inner byte slice.
pub fn is_empty(&self) -> bool
[src]
Is the inner string empty?
Trait Implementations
impl AsRef<[u8]> for Utf8String<'_>
[src]
impl AsRef<str> for Utf8String<'_>
[src]
impl<'a> Clone for Utf8String<'a>
[src]
fn clone(&self) -> Utf8String<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Copy for Utf8String<'a>
[src]
impl<'a> Debug for Utf8String<'a>
[src]
impl<'a> Display for Utf8String<'a>
[src]
impl<'a> Encodable for Utf8String<'a>
[src]
fn encoded_len(&self) -> Result<Length>
[src]
fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>
[src]
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
[src]
fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length>
[src]
fn to_vec(&self) -> Result<Vec<u8>>
[src]
impl<'a> Eq for Utf8String<'a>
[src]
impl<'a> From<&'_ Utf8String<'a>> for Utf8String<'a>
[src]
fn from(value: &Utf8String<'a>) -> Utf8String<'a>
[src]
impl<'a> From<Utf8String<'a>> for Any<'a>
[src]
fn from(utf8_string: Utf8String<'a>) -> Any<'a>
[src]
impl<'a> PartialEq<Utf8String<'a>> for Utf8String<'a>
[src]
fn eq(&self, other: &Utf8String<'a>) -> bool
[src]
fn ne(&self, other: &Utf8String<'a>) -> bool
[src]
impl<'a> StructuralEq for Utf8String<'a>
[src]
impl<'a> StructuralPartialEq for Utf8String<'a>
[src]
impl<'a> Tagged for Utf8String<'a>
[src]
impl<'a> TryFrom<Any<'a>> for Utf8String<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Utf8String<'a>
[src]
impl<'a> Send for Utf8String<'a>
[src]
impl<'a> Sync for Utf8String<'a>
[src]
impl<'a> Unpin for Utf8String<'a>
[src]
impl<'a> UnwindSafe for Utf8String<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,