Trait age_plugin::Callbacks[][src]

pub trait Callbacks<E> {
    fn message(&mut self, message: &str) -> Result<()>;
fn request_public(&mut self, message: &str) -> Result<String>;
fn request_secret(&mut self, message: &str) -> Result<SecretString>;
fn error(&mut self, error: E) -> Result<()>; }
Expand description

The interface that age plugins can use to interact with an age implementation.

Required methods

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.

Requests a non-secret value from the user.

message will be displayed to the user, providing context for the request.

To request secrets, use Callbacks::request_secret.

Requests a secret value from the user, such as a passphrase.

message will be displayed to the user, providing context for the request.

Sends an error.

Note: This API may be removed in a subsequent API refactor, after we’ve figured out how errors should be handled overall, and how to distinguish between hard and soft errors.

Implementors