Skip to main content

Prompt

Trait Prompt 

Source
pub trait Prompt: Send + Sync {
    // Required method
    fn prompt_password(&self, prompt: &str) -> Result<Password>;

    // Provided method
    fn prompt_to_unlock(&self, reason: &str) -> Result<Password> { ... }
}
Expand description

Prompts for passwords.

Required Methods§

Source

fn prompt_password(&self, prompt: &str) -> Result<Password>

Prompts for a password displaying the given prompt.

Provided Methods§

Source

fn prompt_to_unlock(&self, reason: &str) -> Result<Password>

Prompts once for a PIN to unlock an existing object.

This function is intended for consuming artifacts. For example, if a key or subkey is locked and must be unlocked, or a message should be decrypted using a PIN.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§