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::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§
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 · 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
Source§impl FromStr for PrintableString
impl FromStr for PrintableString
Source§impl Hash for PrintableString
impl Hash 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
Source§impl PartialEq for PrintableString
impl PartialEq for PrintableString
Source§impl TryFrom<&str> for PrintableString
impl TryFrom<&str> for PrintableString
Source§fn try_from(input: &str) -> Result<Self, Error>
fn try_from(input: &str) -> Result<Self, 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<Self, Self::Error>
fn try_from(value: String) -> Result<Self, Self::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.