Struct async_mwmr::ReadTransaction
source · pub struct ReadTransaction<D: AsyncDatabase, S: AsyncSpawner, H> { /* private fields */ }
Expand description
ReadTransaction is a read-only transaction.
It is created by calling TransactionDB::read
.
Implementations§
source§impl<D, S, H> ReadTransaction<D, S, H>where
D: AsyncDatabase,
S: AsyncSpawner,
impl<D, S, H> ReadTransaction<D, S, H>where
D: AsyncDatabase,
S: AsyncSpawner,
sourcepub async fn get<'a: 'b, 'b>(
&'a self,
key: &'b D::Key
) -> Result<Option<Either<D::ItemRef<'a>, D::Item>>, D::Error>
pub async fn get<'a: 'b, 'b>( &'a self, key: &'b D::Key ) -> Result<Option<Either<D::ItemRef<'a>, D::Item>>, D::Error>
Looks for key and returns corresponding Item.
sourcepub async fn iter(&self, opts: IteratorOptions) -> D::Iterator<'_>
pub async fn iter(&self, opts: IteratorOptions) -> D::Iterator<'_>
Returns an iterator.
sourcepub async fn keys(&self, opts: KeysOptions) -> D::Keys<'_>
pub async fn keys(&self, opts: KeysOptions) -> D::Keys<'_>
Returns an iterator over keys.
Trait Implementations§
source§impl<D, S, H> Drop for ReadTransaction<D, S, H>where
D: AsyncDatabase,
S: AsyncSpawner,
impl<D, S, H> Drop for ReadTransaction<D, S, H>where
D: AsyncDatabase,
S: AsyncSpawner,
Auto Trait Implementations§
impl<D, S, H> Freeze for ReadTransaction<D, S, H>
impl<D, S, H> !RefUnwindSafe for ReadTransaction<D, S, H>
impl<D, S, H> Send for ReadTransaction<D, S, H>
impl<D, S, H> Sync for ReadTransaction<D, S, H>
impl<D, S, H> Unpin for ReadTransaction<D, S, H>
impl<D, S, H> !UnwindSafe for ReadTransaction<D, S, H>
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