Skip to main content

Prompter

Trait Prompter 

Source
pub trait Prompter: Send {
    // Required methods
    fn prompt_username_password(
        &mut self,
        url: &str,
        git_config: &Config,
    ) -> Option<(String, String)>;
    fn prompt_password(
        &mut self,
        username: &str,
        url: &str,
        git_config: &Config,
    ) -> Option<String>;
    fn prompt_ssh_key_passphrase(
        &mut self,
        private_key_path: &Path,
        git_config: &Config,
    ) -> Option<String>;
}
Expand description

Trait for customizing user prompts.

You can provide an implementor of this trait to customize the way a user is prompted for credentials and passphrases.

Required Methods§

Source

fn prompt_username_password( &mut self, url: &str, git_config: &Config, ) -> Option<(String, String)>

Promp the user for a username and password.

If the prompt fails or the user fails to provide the requested information, this function should return None.

Source

fn prompt_password( &mut self, username: &str, url: &str, git_config: &Config, ) -> Option<String>

Promp the user for a password when the username is already known.

If the prompt fails or the user fails to provide the requested information, this function should return None.

Source

fn prompt_ssh_key_passphrase( &mut self, private_key_path: &Path, git_config: &Config, ) -> Option<String>

Promp the user for the passphrase of an encrypted SSH key.

If the prompt fails or the user fails to provide the requested information, this function should return None.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§