pub struct AsyncReadSession<'manager, 'tree, S: AsyncStore> { /* private fields */ }Expand description
Reusable root-bound read context for an asynchronous store.
All visitors are synchronous. A node is fully loaded before a visitor sees a borrowed slice, and the visitor returns before traversal can await again.
Implementations§
Source§impl<'manager, 'tree, S> AsyncReadSession<'manager, 'tree, S>
impl<'manager, 'tree, S> AsyncReadSession<'manager, 'tree, S>
Sourcepub async fn len(&self) -> Result<u64, Error>
pub async fn len(&self) -> Result<u64, Error>
Return the number of logical entries using the retained root.
Sourcepub async fn is_empty(&self) -> Result<bool, Error>
pub async fn is_empty(&self) -> Result<bool, Error>
Return whether the bound tree contains no entries.
Sourcepub async fn rank(&mut self, key: &[u8]) -> Result<u64, Error>
pub async fn rank(&mut self, key: &[u8]) -> Result<u64, Error>
Return the number of keys strictly less than key.
Sourcepub async fn select_with<R>(
&mut self,
ordinal: u64,
read: impl for<'entry> FnOnce(EntryRef<'entry>) -> R,
) -> Result<Option<R>, Error>
pub async fn select_with<R>( &mut self, ordinal: u64, read: impl for<'entry> FnOnce(EntryRef<'entry>) -> R, ) -> Result<Option<R>, Error>
Visit the zero-based entry at ordinal without copying it.
Sourcepub async fn first_entry_with<R>(
&mut self,
read: impl for<'entry> FnOnce(EntryRef<'entry>) -> R,
) -> Result<Option<R>, Error>
pub async fn first_entry_with<R>( &mut self, read: impl for<'entry> FnOnce(EntryRef<'entry>) -> R, ) -> Result<Option<R>, Error>
Visit the first entry in key order.
Sourcepub async fn last_entry_with<R>(
&mut self,
read: impl for<'entry> FnOnce(EntryRef<'entry>) -> R,
) -> Result<Option<R>, Error>
pub async fn last_entry_with<R>( &mut self, read: impl for<'entry> FnOnce(EntryRef<'entry>) -> R, ) -> Result<Option<R>, Error>
Visit the last entry in key order.
Sourcepub async fn lower_bound_with<R>(
&mut self,
key: &[u8],
read: impl for<'entry> FnOnce(EntryRef<'entry>) -> R,
) -> Result<Option<R>, Error>
pub async fn lower_bound_with<R>( &mut self, key: &[u8], read: impl for<'entry> FnOnce(EntryRef<'entry>) -> R, ) -> Result<Option<R>, Error>
Visit the first entry whose key is at least key.
Sourcepub async fn upper_bound_with<R>(
&mut self,
key: &[u8],
read: impl for<'entry> FnOnce(EntryRef<'entry>) -> R,
) -> Result<Option<R>, Error>
pub async fn upper_bound_with<R>( &mut self, key: &[u8], read: impl for<'entry> FnOnce(EntryRef<'entry>) -> R, ) -> Result<Option<R>, Error>
Visit the first entry whose key is strictly greater than key.
Sourcepub async fn get_with<R>(
&mut self,
key: &[u8],
read: impl FnOnce(&[u8]) -> R,
) -> Result<Option<R>, Error>
pub async fn get_with<R>( &mut self, key: &[u8], read: impl FnOnce(&[u8]) -> R, ) -> Result<Option<R>, Error>
Read a value after all required I/O and before any subsequent await.
Sourcepub async fn get_value_ref_with<R>(
&mut self,
key: &[u8],
read: impl for<'value> FnOnce(ValueRefView<'value>) -> R,
) -> Result<Option<R>, Error>
pub async fn get_value_ref_with<R>( &mut self, key: &[u8], read: impl for<'value> FnOnce(ValueRefView<'value>) -> R, ) -> Result<Option<R>, Error>
Inspect an async-store large-value envelope without copying inline data.
Sourcepub async fn get_many_with<K, F>(
&mut self,
keys: &[K],
visit: F,
) -> Result<(), Error>
pub async fn get_many_with<K, F>( &mut self, keys: &[K], visit: F, ) -> Result<(), Error>
Visit async multi-get results in input order without owning hit values.
Sourcepub async fn scan_range(
&mut self,
start: &[u8],
end: Option<&[u8]>,
visit: impl for<'entry> FnMut(EntryRef<'entry>),
) -> Result<u64, Error>
pub async fn scan_range( &mut self, start: &[u8], end: Option<&[u8]>, visit: impl for<'entry> FnMut(EntryRef<'entry>), ) -> Result<u64, Error>
Visit a half-open range, never holding a borrowed entry across await.
pub async fn scan_range_until<B>( &mut self, start: &[u8], end: Option<&[u8]>, visit: impl for<'entry> FnMut(EntryRef<'entry>) -> ControlFlow<B>, ) -> Result<ScanOutcome<B>, Error>
Sourcepub async fn scan_prefix(
&mut self,
prefix: &[u8],
visit: impl for<'entry> FnMut(EntryRef<'entry>),
) -> Result<u64, Error>
pub async fn scan_prefix( &mut self, prefix: &[u8], visit: impl for<'entry> FnMut(EntryRef<'entry>), ) -> Result<u64, Error>
Visit every key under a prefix without allocating entries.
pub async fn scan_prefix_until<B>( &mut self, prefix: &[u8], visit: impl for<'entry> FnMut(EntryRef<'entry>) -> ControlFlow<B>, ) -> Result<ScanOutcome<B>, Error>
pub async fn scan_range_reverse( &mut self, start: &[u8], end: Option<&[u8]>, visit: impl for<'entry> FnMut(EntryRef<'entry>), ) -> Result<u64, Error>
pub async fn scan_range_reverse_until<B>( &mut self, start: &[u8], end: Option<&[u8]>, visit: impl for<'entry> FnMut(EntryRef<'entry>) -> ControlFlow<B>, ) -> Result<ScanOutcome<B>, Error>
pub async fn scan_prefix_reverse( &mut self, prefix: &[u8], visit: impl for<'entry> FnMut(EntryRef<'entry>), ) -> Result<u64, Error>
pub async fn scan_prefix_reverse_until<B>( &mut self, prefix: &[u8], visit: impl for<'entry> FnMut(EntryRef<'entry>) -> ControlFlow<B>, ) -> Result<ScanOutcome<B>, Error>
Auto Trait Implementations§
impl<'manager, 'tree, S> Freeze for AsyncReadSession<'manager, 'tree, S>
impl<'manager, 'tree, S> RefUnwindSafe for AsyncReadSession<'manager, 'tree, S>where
S: RefUnwindSafe,
impl<'manager, 'tree, S> Send for AsyncReadSession<'manager, 'tree, S>where
S: Sync,
impl<'manager, 'tree, S> Sync for AsyncReadSession<'manager, 'tree, S>where
S: Sync,
impl<'manager, 'tree, S> Unpin for AsyncReadSession<'manager, 'tree, S>
impl<'manager, 'tree, S> UnsafeUnpin for AsyncReadSession<'manager, 'tree, S>
impl<'manager, 'tree, S> UnwindSafe for AsyncReadSession<'manager, 'tree, S>where
S: RefUnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more