Struct distant_ssh2::Ssh2AuthHandler
source · [−]pub struct Ssh2AuthHandler<'a> {
pub on_authenticate: Box<dyn FnMut(Ssh2AuthEvent) -> Result<Vec<String>> + 'a>,
pub on_banner: Box<dyn FnMut(&str) + 'a>,
pub on_host_verify: Box<dyn FnMut(&str) -> Result<bool> + 'a>,
pub on_error: Box<dyn FnMut(&str) + 'a>,
}Expand description
Represents callback functions to be invoked during authentication of an ssh session
Fields
on_authenticate: Box<dyn FnMut(Ssh2AuthEvent) -> Result<Vec<String>> + 'a>Invoked whenever a series of authentication prompts need to be displayed and responded to, receiving one event at a time and returning a collection of answers matching the total prompts provided in the event
Invoked when receiving a banner from the ssh server, receiving the banner as a str, useful to display to the user
on_host_verify: Box<dyn FnMut(&str) -> Result<bool> + 'a>Invoked when the host is unknown for a new ssh connection, receiving the host as a str and returning true if the host is acceptable or false if the host (and thereby ssh session) should be declined
on_error: Box<dyn FnMut(&str) + 'a>Invoked when an error is encountered, receiving the error as a str
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Ssh2AuthHandler<'a>
impl<'a> !Send for Ssh2AuthHandler<'a>
impl<'a> !Sync for Ssh2AuthHandler<'a>
impl<'a> Unpin for Ssh2AuthHandler<'a>
impl<'a> !UnwindSafe for Ssh2AuthHandler<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more