pub struct PrintableString(/* private fields */);aws-lc or ring only.Expand description
ASN.1 PrintableString type.
Supports a subset of the ASCII printable characters (described below).
For the full ASCII character set, use
Ia5String.
§Examples
You can create a PrintableString from a literal string with PrintableString::try_from:
use rcgen::string::PrintableString;
let hello = PrintableString::try_from("hello").unwrap();§Supported characters
PrintableString is a subset of the ASCII printable characters.
For instance, '@' is a printable character as per ASCII but can’t be part of ASN.1’s PrintableString.
The following ASCII characters/ranges are supported:
A..Za..z0..9- “
” (i.e. space) \()+,-./:=?
Implementations§
Trait Implementations§
Source§impl AsRef<str> for PrintableString
impl AsRef<str> for PrintableString
Source§impl Clone for PrintableString
impl Clone for PrintableString
Source§fn clone(&self) -> PrintableString
fn clone(&self) -> PrintableString
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PrintableString
impl Debug for PrintableString
Source§impl Display for PrintableString
impl Display for PrintableString
impl Eq for PrintableString
Source§impl FromStr for PrintableString
impl FromStr for PrintableString
Source§impl Hash for PrintableString
impl Hash for PrintableString
Source§impl PartialEq for PrintableString
impl PartialEq for PrintableString
Source§impl PartialEq<&String> for PrintableString
impl PartialEq<&String> for PrintableString
Source§impl PartialEq<&str> for PrintableString
impl PartialEq<&str> for PrintableString
Source§impl PartialEq<String> for PrintableString
impl PartialEq<String> for PrintableString
Source§impl PartialEq<str> for PrintableString
impl PartialEq<str> for PrintableString
impl StructuralPartialEq for PrintableString
Source§impl TryFrom<&str> for PrintableString
impl TryFrom<&str> for PrintableString
Source§fn try_from(input: &str) -> Result<PrintableString, Error>
fn try_from(input: &str) -> Result<PrintableString, Error>
Converts a &str to a PrintableString.
Any character not in the PrintableString charset will be rejected.
See PrintableString documentation for more information.
The result is allocated on the heap.
Source§impl TryFrom<String> for PrintableString
impl TryFrom<String> for PrintableString
Source§fn try_from(
value: String,
) -> Result<PrintableString, <PrintableString as TryFrom<String>>::Error>
fn try_from( value: String, ) -> Result<PrintableString, <PrintableString as TryFrom<String>>::Error>
Converts a String into a PrintableString
Any character not in the PrintableString charset will be rejected.
See PrintableString documentation for more information.
This conversion does not allocate or copy memory.
Auto Trait Implementations§
impl Freeze for PrintableString
impl RefUnwindSafe for PrintableString
impl Send for PrintableString
impl Sync for PrintableString
impl Unpin for PrintableString
impl UnsafeUnpin for PrintableString
impl UnwindSafe for PrintableString
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more