Struct PrintableString
pub struct PrintableString(/* private fields */);
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..Z
a..z
0..9
- “
\
(
)
+
,
-
.
/
:
=
?
Implementations§
§impl PrintableString
impl PrintableString
Trait Implementations§
§impl AsRef<str> for PrintableString
impl AsRef<str> for PrintableString
§impl Clone for PrintableString
impl Clone for PrintableString
§fn clone(&self) -> PrintableString
fn clone(&self) -> PrintableString
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for PrintableString
impl Debug for PrintableString
§impl Display for PrintableString
impl Display for PrintableString
§impl FromStr for PrintableString
impl FromStr for PrintableString
§impl Hash for PrintableString
impl Hash for PrintableString
§impl PartialEq<&String> for PrintableString
impl PartialEq<&String> for PrintableString
§impl PartialEq<&str> for PrintableString
impl PartialEq<&str> for PrintableString
§impl PartialEq<String> for PrintableString
impl PartialEq<String> for PrintableString
§impl PartialEq<str> for PrintableString
impl PartialEq<str> for PrintableString
§impl PartialEq for PrintableString
impl PartialEq for PrintableString
§impl TryFrom<&str> for PrintableString
impl TryFrom<&str> for PrintableString
§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.
§impl TryFrom<String> for PrintableString
impl TryFrom<String> for PrintableString
§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.
impl Eq for PrintableString
impl StructuralPartialEq for PrintableString
Auto Trait Implementations§
impl Freeze for PrintableString
impl RefUnwindSafe for PrintableString
impl Send for PrintableString
impl Sync for PrintableString
impl Unpin for PrintableString
impl UnwindSafe for PrintableString
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more§impl<T, U> RamaTryInto<U> for Twhere
U: RamaTryFrom<T>,
impl<T, U> RamaTryInto<U> for Twhere
U: RamaTryFrom<T>,
type Error = <U as RamaTryFrom<T>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U> RamaTryInto<U> for Twhere
U: RamaTryFrom<T>,
impl<T, U> RamaTryInto<U> for Twhere
U: RamaTryFrom<T>,
type Error = <U as RamaTryFrom<T>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T> ToSmolStr for T
impl<T> ToSmolStr for T
fn to_smolstr(&self) -> SmolStr
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.