Struct lockchain_core::Vault
[−]
[src]
pub struct Vault<T: Body> { /* fields omitted */ }
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.
Methods
impl<T: Body> Vault<T>
[src]
pub fn new(name: &str, location: &str) -> Vault<T>
[src]
pub fn get_record(&self, name: &str) -> Option<&Record<T>>
[src]
Try to retrieve a record from this vault.
Returns None
if it doesn't exist or can't be retrieved
from the selected storage backend for this vault.
pub fn contains(&self, name: &str) -> bool
[src]
Checks if a record is present in this vault without ever trying to load it.
This is good to check the in-memory metadata without causing load on a central backend store that might not be located on the same machine as the front-end client.
pub fn add_record(&mut self, key: &str, category: &str, tags: Vec<&str>)
[src]
Adds a new (empty) record to the vault
pub fn add_data(&mut self, record: &str, key: &str, data: Payload) -> Option<()>
[src]
Fill an existing record with data