Struct engine::vault::view::DbView[][src]

pub struct DbView<P: BoxProvider> {
    pub vaults: HashMap<VaultId, Vault<P>>,
}

A view over the data inside of the Stronghold database.

Fields

vaults: HashMap<VaultId, Vault<P>>

Implementations

impl<P: BoxProvider> DbView<P>[src]

pub fn new() -> DbView<P>[src]

Create a new Database View.

pub fn init_vault(&mut self, key: &Key<P>, vid: VaultId) -> Result<()>[src]

Initialize a new vault if it doesn’t exist.

pub fn write(
    &mut self,
    key: &Key<P>,
    vid: VaultId,
    rid: RecordId,
    data: &[u8],
    record_hint: RecordHint
) -> Result<()>
[src]

Write a new record to the Vault.

pub fn list_hints_and_ids(
    &self,
    key: &Key<P>,
    vid: VaultId
) -> Vec<(RecordId, RecordHint)>
[src]

Lists all of the hints and ids for the given vault.

pub fn contains_record(
    &mut self,
    key: &Key<P>,
    vid: VaultId,
    rid: RecordId
) -> bool
[src]

Check to see if vault contains a specific record id.

pub fn get_guard<F>(
    &mut self,
    key: &Key<P>,
    vid: VaultId,
    rid: RecordId,
    f: F
) -> Result<()> where
    F: FnOnce(GuardedVec<u8>) -> Result<()>, 
[src]

execute a procedure on the guarded record data.

pub fn exec_proc<F>(
    &mut self,
    key0: &Key<P>,
    vid0: VaultId,
    rid0: RecordId,
    key1: &Key<P>,
    vid1: VaultId,
    rid1: RecordId,
    hint: RecordHint,
    f: F
) -> Result<()> where
    F: FnOnce(GuardedVec<u8>) -> Result<Vec<u8>>, 
[src]

pub fn revoke_record(
    &mut self,
    key: &Key<P>,
    vid: VaultId,
    rid: RecordId
) -> Result<()>
[src]

mark a record as revoked.

pub fn garbage_collect_vault(
    &mut self,
    key: &Key<P>,
    vid: VaultId
) -> Result<()>
[src]

Garbage collect a vault.

pub fn clear(&mut self) -> Result<()>[src]

Trait Implementations

impl<P: Clone + BoxProvider> Clone for DbView<P>[src]

impl<P: Default + BoxProvider> Default for DbView<P>[src]

impl<'de, P: BoxProvider> Deserialize<'de> for DbView<P> where
    P: Deserialize<'de>, 
[src]

impl<P: BoxProvider> Serialize for DbView<P> where
    P: Serialize
[src]

Auto Trait Implementations

impl<P> !RefUnwindSafe for DbView<P>

impl<P> Send for DbView<P> where
    P: Send

impl<P> Sync for DbView<P> where
    P: Sync

impl<P> Unpin for DbView<P> where
    P: Unpin

impl<P> UnwindSafe for DbView<P> where
    P: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.