Trait lockchain_core::traits::Vault[][src]

pub trait Vault<T>: Send where
    T: Body
{ fn new(name: &str, location: &str) -> Self;
fn fetch(&mut self);
fn pull(&mut self, name: &str);
fn sync(&mut self);
fn get_record(&self, name: &str) -> Option<&Record<T>>;
fn contains(&self, name: &str) -> bool;
fn add_record(&mut self, key: &str, category: &str, tags: Vec<&str>);
fn delete_record(&mut self, record: &str) -> Option<Record<T>>;
fn add_data(&mut self, record: &str, key: &str, data: Payload) -> Option<()>;
fn get_data(&self, record: &str, key: &str) -> Option<&Payload>; }

Trait for an in-memory representation of a lockchain vault.

By itself it represents vault metadata (name, users, location) as well as a list of record headers.

To provide on-disk functionality it requires the -storage trait library and for encrypted file access the -crypto crate.

The body backend is being being generic with the Body trait.

Required Methods

A shared constructor for all vault implementations

Fetch metadata headers for all records

Pull a specific record from the backend

Sync all changes back to the backend

Get a complete record from this vault

Probe if a record is contained

Add a new record to this vault

Delete a record from this vault

Add data to an existing record, overwriting existing fields

Get the (latest) value of a specific record data field

Implementors