pub struct DbHandle<'db, S> { /* private fields */ }Expand description
A handle to the database during some operation.
This wraps calls to the Db so that any get calls
will be automatically registered as dependencies of
the current operation.
Implementations§
Source§impl<S: Storage> DbHandle<'_, S>
impl<S: Storage> DbHandle<'_, S>
Sourcepub fn get<C: Computation>(&self, compute: C) -> C::Outputwhere
S: StorageFor<C>,
pub fn get<C: Computation>(&self, compute: C) -> C::Outputwhere
S: StorageFor<C>,
Locking behavior: This function locks the cell corresponding to the given computation. This can cause a deadlock if the computation recursively depends on itself.
Sourcepub fn accumulate<Item>(&self, item: Item)where
S: Accumulate<Item>,
pub fn accumulate<Item>(&self, item: Item)where
S: Accumulate<Item>,
Accumulate an item in the current computation. This item can be retrieved along
with all other accumulated items in this computation and its dependencies via
a call to get_accumulated.
This is most often used for operations like pushing diagnostics or logs.
Trait Implementations§
Auto Trait Implementations§
impl<'db, S> Freeze for DbHandle<'db, S>
impl<'db, S> !RefUnwindSafe for DbHandle<'db, S>
impl<'db, S> Send for DbHandle<'db, S>where
S: Sync,
impl<'db, S> Sync for DbHandle<'db, S>where
S: Sync,
impl<'db, S> Unpin for DbHandle<'db, S>
impl<'db, S> !UnwindSafe for DbHandle<'db, S>
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