pub struct Db<C: CanisterKind> { /* private fields */ }Expand description
Db
A handle to the set of stores registered for a specific canister domain.
Cis theCanisterKind(schema canister marker).
The Db acts as the entry point for querying, saving, and deleting entities
within a single canister’s store registry.
Implementations§
Source§impl<C: CanisterKind> Db<C>
impl<C: CanisterKind> Db<C>
pub const fn new( data: &'static LocalKey<DataStoreRegistry>, index: &'static LocalKey<IndexStoreRegistry>, ) -> Self
pub const fn context<E>(&self) -> Context<'_, E>where
E: EntityKind<Canister = C>,
pub fn with_data<R>(&self, f: impl FnOnce(&DataStoreRegistry) -> R) -> R
pub fn with_index<R>(&self, f: impl FnOnce(&IndexStoreRegistry) -> R) -> R
Trait Implementations§
Source§impl<C: CanisterKind> Clone for Db<C>
impl<C: CanisterKind> Clone for Db<C>
impl<C: CanisterKind> Copy for Db<C>
Auto Trait Implementations§
impl<C> Freeze for Db<C>
impl<C> RefUnwindSafe for Db<C>where
C: RefUnwindSafe,
impl<C> Send for Db<C>where
C: Send,
impl<C> Sync for Db<C>where
C: Sync,
impl<C> Unpin for Db<C>where
C: Unpin,
impl<C> UnwindSafe for Db<C>where
C: UnwindSafe,
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