Struct ssh_key::AlgorithmName
source · pub struct AlgorithmName { /* private fields */ }
Available on crate feature
alloc
only.Expand description
A string representing an additional algorithm name in the name@domainname
format (see
RFC4251 § 6).
Additional algorithm names must be non-empty printable ASCII strings no longer than 64 characters.
This also provides a name-cert-v01@domainnname
string identifier for the corresponding
OpenSSH certificate format, derived from the specified name@domainname
string.
NOTE: RFC4251 specifies additional validation criteria for algorithm names, but we do not implement all of them here.
Implementations§
source§impl AlgorithmName
impl AlgorithmName
sourcepub fn new(id: impl Into<String>) -> Result<Self, LabelError>
pub fn new(id: impl Into<String>) -> Result<Self, LabelError>
Create a new algorithm identifier.
sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Get the string identifier which corresponds to this algorithm name.
sourcepub fn certificate_type(&self) -> String
pub fn certificate_type(&self) -> String
Get the string identifier which corresponds to the OpenSSH certificate format.
sourcepub fn from_certificate_type(id: &str) -> Result<Self, LabelError>
pub fn from_certificate_type(id: &str) -> Result<Self, LabelError>
Create a new AlgorithmName
from an OpenSSH certificate format string identifier.
Trait Implementations§
source§impl Clone for AlgorithmName
impl Clone for AlgorithmName
source§fn clone(&self) -> AlgorithmName
fn clone(&self) -> AlgorithmName
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AlgorithmName
impl Debug for AlgorithmName
source§impl FromStr for AlgorithmName
impl FromStr for AlgorithmName
§type Err = LabelError
type Err = LabelError
The associated error which can be returned from parsing.
source§impl Hash for AlgorithmName
impl Hash for AlgorithmName
source§impl Ord for AlgorithmName
impl Ord for AlgorithmName
source§fn cmp(&self, other: &AlgorithmName) -> Ordering
fn cmp(&self, other: &AlgorithmName) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for AlgorithmName
impl PartialEq for AlgorithmName
source§fn eq(&self, other: &AlgorithmName) -> bool
fn eq(&self, other: &AlgorithmName) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for AlgorithmName
impl PartialOrd for AlgorithmName
source§fn partial_cmp(&self, other: &AlgorithmName) -> Option<Ordering>
fn partial_cmp(&self, other: &AlgorithmName) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for AlgorithmName
impl StructuralPartialEq for AlgorithmName
Auto Trait Implementations§
impl Freeze for AlgorithmName
impl RefUnwindSafe for AlgorithmName
impl Send for AlgorithmName
impl Sync for AlgorithmName
impl Unpin for AlgorithmName
impl UnwindSafe for AlgorithmName
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