pub enum DirectoryString<'a> {
TeletexString(TeletexString),
PrintableString(PrintableStringRef<'a>),
UniversalString(UniversalString),
Utf8String(Utf8StringRef<'a>),
BmpString(BmpString),
}Variants§
TeletexString(TeletexString)
PrintableString(PrintableStringRef<'a>)
UniversalString(UniversalString)
Utf8String(Utf8StringRef<'a>)
BmpString(BmpString)
Implementations§
Source§impl<'a> DirectoryString<'a>
impl<'a> DirectoryString<'a>
Sourcepub fn from_der(data: &'a [u8]) -> Result<Self>
pub fn from_der(data: &'a [u8]) -> Result<Self>
Parse a DER-encoded DirectoryString from borrowed bytes.
The returned value borrows from data for zero-copy fields.
Sourcepub fn to_der(&self) -> Result<Vec<u8>>
pub fn to_der(&self) -> Result<Vec<u8>>
Encode this value to DER bytes.
Returns a synta::Result wrapping the DER-encoded bytes,
or an error if encoding fails.
Sourcepub fn format_asn1(&self, mode: Asn1FormatMode) -> String
pub fn format_asn1(&self, mode: Asn1FormatMode) -> String
Format the encoded DER bytes of this value.
mode controls the output style:
synta::Asn1FormatMode::Hex— space-separated uppercase hex bytessynta::Asn1FormatMode::Text— indented human-readable ASN.1 dump
Trait Implementations§
Source§impl<'a> Clone for DirectoryString<'a>
impl<'a> Clone for DirectoryString<'a>
Source§fn clone(&self) -> DirectoryString<'a>
fn clone(&self) -> DirectoryString<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DirectoryString<'a>
impl<'a> Debug for DirectoryString<'a>
Source§impl<'a> Decode<'a> for DirectoryString<'a>
impl<'a> Decode<'a> for DirectoryString<'a>
Source§impl<'a> Encode for DirectoryString<'a>
impl<'a> Encode for DirectoryString<'a>
Source§impl<'a> PartialEq for DirectoryString<'a>
impl<'a> PartialEq for DirectoryString<'a>
Source§fn eq(&self, other: &DirectoryString<'a>) -> bool
fn eq(&self, other: &DirectoryString<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for DirectoryString<'a>
Source§impl<'a> TagForOptional for DirectoryString<'a>
impl<'a> TagForOptional for DirectoryString<'a>
Source§fn optional_tag() -> Option<Tag>
fn optional_tag() -> Option<Tag>
CHOICE types have no single fixed tag; return None so that
callers use accepts_tag_for_optional instead.
Source§fn accepts_tag_for_optional(tag: Tag) -> bool
fn accepts_tag_for_optional(tag: Tag) -> bool
Return true when tag matches any of the CHOICE variant tags.
This avoids the unreachable!() that Tagged::tag() would hit
via the blanket impl<T: Tagged> TagForOptional for T.
Auto Trait Implementations§
impl<'a> Freeze for DirectoryString<'a>
impl<'a> RefUnwindSafe for DirectoryString<'a>
impl<'a> Send for DirectoryString<'a>
impl<'a> Sync for DirectoryString<'a>
impl<'a> Unpin for DirectoryString<'a>
impl<'a> UnsafeUnpin for DirectoryString<'a>
impl<'a> UnwindSafe for DirectoryString<'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