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<(), ()>;
}The interface that age plugins can use to interact with an age implementation.
Required methods
fn message(&mut self, message: &str) -> Result<(), ()>[src]
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(&mut self, message: &str) -> Result<String, ()>[src]
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.
fn request_secret(&mut self, message: &str) -> Result<SecretString, ()>[src]
Requests a secret value from the user, such as a passphrase.
message will be displayed to the user, providing context for the request.
fn error(&mut self, error: E) -> Result<(), ()>[src]
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.