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]
&mut self,
key: &Key<P>,
vid: VaultId,
rid: RecordId,
data: &[u8],
record_hint: RecordHint
) -> Result<()>
Write a new record to the Vault.
pub fn list_hints_and_ids(
&self,
key: &Key<P>,
vid: VaultId
) -> Vec<(RecordId, RecordHint)>
[src]
&self,
key: &Key<P>,
vid: VaultId
) -> Vec<(RecordId, RecordHint)>
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]
&mut self,
key: &Key<P>,
vid: VaultId,
rid: RecordId
) -> bool
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]
&mut self,
key: &Key<P>,
vid: VaultId,
rid: RecordId,
f: F
) -> Result<()> where
F: FnOnce(GuardedVec<u8>) -> Result<()>,
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]
&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>>,
pub fn revoke_record(
&mut self,
key: &Key<P>,
vid: VaultId,
rid: RecordId
) -> Result<()>
[src]
&mut self,
key: &Key<P>,
vid: VaultId,
rid: RecordId
) -> Result<()>
mark a record as revoked.
pub fn garbage_collect_vault(
&mut self,
key: &Key<P>,
vid: VaultId
) -> Result<()>
[src]
&mut self,
key: &Key<P>,
vid: VaultId
) -> Result<()>
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]
P: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<P: BoxProvider> Serialize for DbView<P> where
P: Serialize,
[src]
P: Serialize,
Auto Trait Implementations
impl<P> !RefUnwindSafe for DbView<P>
impl<P> Send for DbView<P> where
P: Send,
P: Send,
impl<P> Sync for DbView<P> where
P: Sync,
P: Sync,
impl<P> Unpin for DbView<P> where
P: Unpin,
P: Unpin,
impl<P> UnwindSafe for DbView<P> where
P: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,