Skip to main content

SecretBackend

Trait SecretBackend 

Source
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§

Source

fn protection(&self) -> Protection

Source

fn get(&self, app: &str, key: &str) -> Result<Option<Secret>, SecretError>

Source

fn put( &self, app: &str, key: &str, value: &[u8], label: &str, ) -> Result<(), SecretError>

Source

fn delete(&self, app: &str, key: &str) -> Result<(), SecretError>

Provided Methods§

Source

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.

Source

fn probe(&self) -> Result<(), SecretError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§