#[non_exhaustive]pub enum AuthMethod {
Password(String),
PrivateKey {
key_data: String,
key_pass: Option<String>,
},
PrivateKeyFile {
key_file_path: PathBuf,
key_pass: Option<String>,
},
PublicKeyFile {
key_file_path: PathBuf,
},
KeyboardInteractive(AuthKeyboardInteractive),
}
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.
Password(String)
PrivateKey
PrivateKeyFile
PublicKeyFile
KeyboardInteractive(AuthKeyboardInteractive)
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<T: AsRef<Path>>( key_file_path: T, passphrase: Option<&str>, ) -> Self
pub fn with_public_key_file<T: AsRef<Path>>(key_file_path: T) -> Self
pub const fn with_keyboard_interactive(auth: AuthKeyboardInteractive) -> 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 From<AuthKeyboardInteractive> for AuthMethod
impl From<AuthKeyboardInteractive> for AuthMethod
Source§fn from(value: AuthKeyboardInteractive) -> Self
fn from(value: AuthKeyboardInteractive) -> Self
Converts to this type from the input type.
Source§impl Hash for AuthMethod
impl Hash for AuthMethod
Source§impl PartialEq for AuthMethod
impl PartialEq for AuthMethod
impl Eq for AuthMethod
impl StructuralPartialEq for AuthMethod
Auto Trait Implementations§
impl Freeze for AuthMethod
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