Trait Backend

Source
pub trait Backend {
    // Required methods
    fn store(&mut self, encrypted: Encrypted) -> Result<()>;
    fn load(&self, name: String) -> Result<Encrypted>;
    fn remove(&mut self, name: String) -> Result<()>;
    fn list(&self) -> Result<Vec<Encrypted>>;
}
Expand description

Storage behavior: what does it mean to store/load/..?

A few backends are implemented by default (YAML and Folder at this time.) You are free to implement your own Backend (that connects to a remote server for example) and initialize a new Database with it.

Required Methods§

Source

fn store(&mut self, encrypted: Encrypted) -> Result<()>

Source

fn load(&self, name: String) -> Result<Encrypted>

Source

fn remove(&mut self, name: String) -> Result<()>

Source

fn list(&self) -> Result<Vec<Encrypted>>

Implementors§