pub struct MemoryVault { /* private fields */ }Expand description
RAM-only vault: nothing touches disk and everything is lost on restart.
Implementations§
Source§impl MemoryVault
impl MemoryVault
Trait Implementations§
Source§impl Default for MemoryVault
impl Default for MemoryVault
Source§impl Vault for MemoryVault
impl Vault for MemoryVault
Source§fn get_or_create(
&self,
scope: &ScopeId,
kind: &EntityKind,
value: &str,
) -> Result<u64, VaultError>
fn get_or_create( &self, scope: &ScopeId, kind: &EntityKind, value: &str, ) -> Result<u64, VaultError>
Returns the placeholder number for
value, creating one if needed. The
same value of the same kind in the same scope always gets the same number.Source§fn lookup(
&self,
scope: &ScopeId,
kind: &EntityKind,
n: u64,
) -> Result<Option<String>, VaultError>
fn lookup( &self, scope: &ScopeId, kind: &EntityKind, n: u64, ) -> Result<Option<String>, VaultError>
Returns the value behind placeholder number
n, if this scope knows it.Source§fn reserve(
&self,
scope: &ScopeId,
kind: &EntityKind,
n: u64,
) -> Result<(), VaultError>
fn reserve( &self, scope: &ScopeId, kind: &EntityKind, n: u64, ) -> Result<(), VaultError>
Makes sure number
n is never handed out for a new value. Used for
placeholder-shaped text the user wrote themselves.Auto Trait Implementations§
impl !Freeze for MemoryVault
impl RefUnwindSafe for MemoryVault
impl Send for MemoryVault
impl Sync for MemoryVault
impl Unpin for MemoryVault
impl UnsafeUnpin for MemoryVault
impl UnwindSafe for MemoryVault
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more