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

pub trait Vault<T>: Send where
    T: Body
{ fn new(name: &str, location: &str) -> Self;
fn metadata(&self) -> VaultMetadata;
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>;
fn meta_add_domain(&mut self, domain: &str) -> Option<()>;
fn meta_pull_domain(&self, domain: &str) -> Option<&MetaDomain>;
fn meta_push_domain(&mut self, domain: MetaDomain) -> Option<()>;
fn meta_set(
        &mut self,
        domain: &str,
        name: &str,
        data: Payload
    ) -> Option<()>;
fn meta_get(&mut self, domain: &str, name: &str) -> Option<Payload>;
fn meta_exists(&self, domain: &str) -> bool; }

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

Get basic vault metadata

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

Adds a domain space to the metadata store inside the vault

A domain is a collection metadata files that can be returned with a single pull request

Returns all records from a meta domain

Entirely replace a meta domain in the store

Set the value of a field inside a domain. Field names must not collide

Get the value of a (unique) field inside a domain

Check if a metadomain exists, regardless of data or depth

Implementors