pub struct State { /* private fields */ }Expand description
The persistent state database.
Implementations§
Source§impl State
impl State
Sourcepub fn open(path: &Path) -> VtaResult<State>
pub fn open(path: &Path) -> VtaResult<State>
Open (creating if absent) the state database at path and ensure the
schema-version marker is present.
Sourcepub fn schema_version(&self) -> VtaResult<u32>
pub fn schema_version(&self) -> VtaResult<u32>
The on-disk schema version (0 if unset).
Sourcepub fn put_store_entry(
&self,
store_key: &str,
meta: &StoreEntryMeta,
) -> VtaResult<()>
pub fn put_store_entry( &self, store_key: &str, meta: &StoreEntryMeta, ) -> VtaResult<()>
Record (or replace) the metadata for a store entry, keyed by its store key.
Sourcepub fn get_store_entry(
&self,
store_key: &str,
) -> VtaResult<Option<StoreEntryMeta>>
pub fn get_store_entry( &self, store_key: &str, ) -> VtaResult<Option<StoreEntryMeta>>
Look up store-entry metadata by store key.
Sourcepub fn append_generation(&self, rec: &GenerationRecord) -> VtaResult<()>
pub fn append_generation(&self, rec: &GenerationRecord) -> VtaResult<()>
Append a generation record (keyed by its id).
Sourcepub fn get_generation(&self, id: u64) -> VtaResult<Option<GenerationRecord>>
pub fn get_generation(&self, id: u64) -> VtaResult<Option<GenerationRecord>>
Fetch a generation record by id.
Sourcepub fn set_current(&self, id: u64) -> VtaResult<()>
pub fn set_current(&self, id: u64) -> VtaResult<()>
Set the current (active) generation pointer.
Auto Trait Implementations§
impl !RefUnwindSafe for State
impl !UnwindSafe for State
impl Freeze for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
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