pub struct AuthorizedKeyEntry(String);
Expand description
An entry of an authorized_keys file
This type ensures compliance with SSH’s AuhtorizedKeysFile format.
Tuple Fields§
§0: String
Implementations§
Source§impl AuthorizedKeyEntry
impl AuthorizedKeyEntry
Sourcepub fn new(entry: String) -> Result<Self, Error>
pub fn new(entry: String) -> Result<Self, Error>
Creates a new AuthorizedKeyEntry
§Errors
Returns an error, if data
can not be converted to an
[ssh_key::authorized_keys::Entry
].
§Examples
use nethsm_config::AuthorizedKeyEntry;
AuthorizedKeyEntry::new("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPkpXKiNhy39A3bZ1u19a5d4sFwYMBkWQyCbzgUfdKBm user@host".to_string())?;
// this fails because the empty string is not a valid AuthorizedKeyEntry
assert!(AuthorizedKeyEntry::new("".to_string()).is_err());
Trait Implementations§
Source§impl AsRef<str> for AuthorizedKeyEntry
impl AsRef<str> for AuthorizedKeyEntry
Source§impl Clone for AuthorizedKeyEntry
impl Clone for AuthorizedKeyEntry
Source§fn clone(&self) -> AuthorizedKeyEntry
fn clone(&self) -> AuthorizedKeyEntry
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 AuthorizedKeyEntry
impl Debug for AuthorizedKeyEntry
Source§impl<'de> Deserialize<'de> for AuthorizedKeyEntry
impl<'de> Deserialize<'de> for AuthorizedKeyEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for AuthorizedKeyEntry
impl Display for AuthorizedKeyEntry
Source§impl From<AuthorizedKeyEntry> for String
impl From<AuthorizedKeyEntry> for String
Source§fn from(value: AuthorizedKeyEntry) -> Self
fn from(value: AuthorizedKeyEntry) -> Self
Converts to this type from the input type.
Source§impl FromStr for AuthorizedKeyEntry
impl FromStr for AuthorizedKeyEntry
Source§impl Hash for AuthorizedKeyEntry
impl Hash for AuthorizedKeyEntry
Source§impl PartialEq for AuthorizedKeyEntry
impl PartialEq for AuthorizedKeyEntry
Source§impl Serialize for AuthorizedKeyEntry
impl Serialize for AuthorizedKeyEntry
Source§impl TryFrom<&AuthorizedKeyEntry> for Entry
impl TryFrom<&AuthorizedKeyEntry> for Entry
Source§impl TryFrom<String> for AuthorizedKeyEntry
impl TryFrom<String> for AuthorizedKeyEntry
Source§impl Zeroize for AuthorizedKeyEntry
impl Zeroize for AuthorizedKeyEntry
impl Eq for AuthorizedKeyEntry
impl StructuralPartialEq for AuthorizedKeyEntry
Auto Trait Implementations§
impl Freeze for AuthorizedKeyEntry
impl RefUnwindSafe for AuthorizedKeyEntry
impl Send for AuthorizedKeyEntry
impl Sync for AuthorizedKeyEntry
impl Unpin for AuthorizedKeyEntry
impl UnwindSafe for AuthorizedKeyEntry
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
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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key
and return true
if they are equal.