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

on_banner: Box<dyn FnMut(&str) + 'a>

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

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Applies the Compat adapter by value. Read more

Applies the Compat adapter by shared reference. Read more

Applies the Compat adapter by mutable reference. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.