Skip to main content

StoreBackend

Trait StoreBackend 

Source
pub trait StoreBackend: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn open(&self, opts: &Options) -> Result<Box<dyn StoreInstance>>;
}
Expand description

A backend factory: knows how to open a connection to a keystore.

Implementations are stateless factories; per-keystore mutable state lives in the StoreInstance they produce. Send + Sync so the registry can hold a &'static dyn StoreBackend safely.

Required Methods§

Source

fn name(&self) -> &'static str

Wire name advertised to the FFI caller, e.g. "memory", "filesystem". ASCII, case-sensitive.

Source

fn open(&self, opts: &Options) -> Result<Box<dyn StoreInstance>>

Open the backend and return a per-keystore instance handle.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§