pub trait SecretBackend: Send + Sync {
// Required methods
fn protection(&self) -> Protection;
fn get(&self, app: &str, key: &str) -> Result<Option<Secret>, SecretError>;
fn put(
&self,
app: &str,
key: &str,
value: &[u8],
label: &str,
) -> Result<(), SecretError>;
fn delete(&self, app: &str, key: &str) -> Result<(), SecretError>;
// Provided methods
fn entries(&self) -> Result<Vec<(String, String)>, SecretError> { ... }
fn probe(&self) -> Result<(), SecretError> { ... }
}Required Methods§
fn protection(&self) -> Protection
fn get(&self, app: &str, key: &str) -> Result<Option<Secret>, SecretError>
fn put( &self, app: &str, key: &str, value: &[u8], label: &str, ) -> Result<(), SecretError>
fn delete(&self, app: &str, key: &str) -> Result<(), SecretError>
Provided Methods§
Sourcefn entries(&self) -> Result<Vec<(String, String)>, SecretError>
fn entries(&self) -> Result<Vec<(String, String)>, SecretError>
Every entry this store holds on this machine, as (app, key), whether or not this
process may read its secret: what a migration that moves entries into a vault walks. A
backend that keeps its entries where it cannot name them answers none, and whatever
walks them then moves none, which is safe.
fn probe(&self) -> Result<(), SecretError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".