Enum async_ssh2_tokio::client::AuthMethod
source · #[non_exhaustive]
pub enum AuthMethod {
Password(String),
PrivateKey(String, Option<String>),
PrivateKeyFile(String, Option<String>),
}Expand description
An authentification token, currently only by password.
Used when creating a Client for authentification.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
source§impl AuthMethod
impl AuthMethod
sourcepub fn with_password(password: &str) -> Self
pub fn with_password(password: &str) -> Self
Convenience method to create a AuthMethod from a string literal.
pub fn with_key(key: &str, passphrase: Option<&str>) -> Self
pub fn with_key_file(key_file_name: &str, passphrase: Option<&str>) -> Self
Trait Implementations§
source§impl Clone for AuthMethod
impl Clone for AuthMethod
source§fn clone(&self) -> AuthMethod
fn clone(&self) -> AuthMethod
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 AuthMethod
impl Debug for AuthMethod
source§impl Hash for AuthMethod
impl Hash for AuthMethod
source§impl PartialEq<AuthMethod> for AuthMethod
impl PartialEq<AuthMethod> for AuthMethod
source§fn eq(&self, other: &AuthMethod) -> bool
fn eq(&self, other: &AuthMethod) -> bool
This method tests for
self and other values to be equal, and is used
by ==.