Trait age::Callbacks [−][src]
pub trait Callbacks {
fn display_message(&self, message: &str);
fn request_public_string(&self, description: &str) -> Option<String>;
fn request_passphrase(&self, description: &str) -> Option<SecretString>;
}
Expand description
Callbacks that might be triggered during encryption or decryption.
Structs that implement this trait should be given directly to the individual
Recipient
or Identity
implementations that require them.
Required methods
fn display_message(&self, message: &str)
fn display_message(&self, message: &str)
Shows a message to the user.
This can be used to prompt the user to take some physical action, such as inserting a hardware key.
fn request_public_string(&self, description: &str) -> Option<String>
fn request_public_string(&self, description: &str) -> Option<String>
Requests non-private input from the user.
To request private inputs, use Callbacks::request_passphrase
.
fn request_passphrase(&self, description: &str) -> Option<SecretString>
fn request_passphrase(&self, description: &str) -> Option<SecretString>
Requests a passphrase to decrypt a key.