Enum async_ssh2_tokio::client::AuthMethod
source · #[non_exhaustive]pub enum AuthMethod {
Password(String),
PrivateKey {
key_data: String,
key_pass: Option<String>,
},
PrivateKeyFile {
key_file_name: String,
key_pass: 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 ==
.impl Eq for AuthMethod
impl StructuralEq for AuthMethod
impl StructuralPartialEq for AuthMethod
Auto Trait Implementations§
impl RefUnwindSafe for AuthMethod
impl Send for AuthMethod
impl Sync for AuthMethod
impl Unpin for AuthMethod
impl UnwindSafe for AuthMethod
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