pub struct Database { /* private fields */ }
Expand description
Database used to access persisted data
This an abstraction around an Rkv database
An instance on this database is created each time the component is loaded
if there is persisted data, the get
functions should retrieve it
Implementations§
source§impl Database
impl Database
sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
Main constructor for a database Initiates the Rkv database to be used to retrieve persisted data
§Arguments
path
: A path to the persisted data, this is provided by the consuming application
pub fn open_single<P: AsRef<Path>>( path: P, store_id: StoreId, ) -> Result<SingleStoreDatabase>
sourcepub fn get_store(&self, store_id: StoreId) -> &SingleStore
pub fn get_store(&self, store_id: StoreId) -> &SingleStore
Gets a Store object, which used with the writer returned by
self.write()
to update the database in a transaction.
pub fn open_rkv<P: AsRef<Path>>(path: P) -> Result<Rkv<SafeModeEnvironment>>
Trait Implementations§
source§impl TryFrom<&Database> for EventStore
impl TryFrom<&Database> for EventStore
source§type Error = NimbusError
type Error = NimbusError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl !Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read more