pub struct CallbackPassphraseProvider { /* private fields */ }Expand description
A PassphraseProvider that delegates to a callback function.
This is useful for GUI applications and FFI bindings where the passphrase input mechanism is provided externally.
§Examples
ⓘ
use auths_core::signing::{CallbackPassphraseProvider, PassphraseProvider};
let provider = CallbackPassphraseProvider::new(|prompt| {
// In a real GUI, this would show a dialog
Ok("user-entered-passphrase".to_string())
});Implementations§
Source§impl CallbackPassphraseProvider
impl CallbackPassphraseProvider
Trait Implementations§
Source§impl PassphraseProvider for CallbackPassphraseProvider
impl PassphraseProvider for CallbackPassphraseProvider
Source§fn get_passphrase(
&self,
prompt_message: &str,
) -> Result<Zeroizing<String>, AgentError>
fn get_passphrase( &self, prompt_message: &str, ) -> Result<Zeroizing<String>, AgentError>
Securely obtains a passphrase, potentially by prompting the user. Read more
Source§fn on_incorrect_passphrase(&self, _prompt_message: &str)
fn on_incorrect_passphrase(&self, _prompt_message: &str)
Notifies the provider that the passphrase returned for
prompt_message was wrong. Read moreAuto Trait Implementations§
impl Freeze for CallbackPassphraseProvider
impl !RefUnwindSafe for CallbackPassphraseProvider
impl Send for CallbackPassphraseProvider
impl Sync for CallbackPassphraseProvider
impl Unpin for CallbackPassphraseProvider
impl UnsafeUnpin for CallbackPassphraseProvider
impl !UnwindSafe for CallbackPassphraseProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more