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

pub struct Vault<P: BoxProvider> { /* fields omitted */ }

A enclave of data that is encrypted under one key.

Implementations

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

pub fn init_vault(key: &Key<P>) -> Result<Vault<P>>[src]

pub fn add_or_update_record(
    &mut self,
    key: &Key<P>,
    id: ChainId,
    data: &[u8],
    record_hint: RecordHint
) -> Result<()>
[src]

Adds a new entry to the vault if the entry doesn’t already exist. Otherwise, updates the data in the existing entry as long as it hasn’t been revoked.

pub fn revoke(&mut self, key: &Key<P>, id: ChainId) -> Result<()>[src]

Revokes an entry by its chain id. Does nothing if the entry doesn’t exist.

pub fn get_guard(&self, key: &Key<P>, id: ChainId) -> Result<GuardedVec<u8>>[src]

pub fn garbage_collect(&mut self)[src]

Sorts through all of the vault entries and garbage collects any revoked entries.

Trait Implementations

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

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

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

Auto Trait Implementations

impl<P> !RefUnwindSafe for Vault<P>

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

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

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

impl<P> UnwindSafe for Vault<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.