Struct redb::ReadOnlyTable
source · pub struct ReadOnlyTable<K: Key + 'static, V: Value + 'static> { /* private fields */ }Expand description
A read-only table
Implementations§
source§impl<K: Key + 'static, V: Value + 'static> ReadOnlyTable<K, V>
impl<K: Key + 'static, V: Value + 'static> ReadOnlyTable<K, V>
sourcepub fn range<'a, KR>(
&self,
range: impl RangeBounds<KR>
) -> Result<Range<'static, K, V>, StorageError>
pub fn range<'a, KR>( &self, range: impl RangeBounds<KR> ) -> Result<Range<'static, K, V>, StorageError>
This method is like ReadableTable::range(), but the iterator is reference counted and keeps the transaction
alive until it is dropped.
Trait Implementations§
source§impl<K: Key + 'static, V: Value + 'static> ReadableTable<K, V> for ReadOnlyTable<K, V>
impl<K: Key + 'static, V: Value + 'static> ReadableTable<K, V> for ReadOnlyTable<K, V>
source§fn get<'a>(
&self,
key: impl Borrow<K::SelfType<'a>>
) -> Result<Option<AccessGuard<'_, V>>, StorageError>where
K: 'a,
fn get<'a>(
&self,
key: impl Borrow<K::SelfType<'a>>
) -> Result<Option<AccessGuard<'_, V>>, StorageError>where
K: 'a,
Returns the value corresponding to the given key
source§fn range<'a, KR>(
&self,
range: impl RangeBounds<KR> + 'a
) -> Result<Range<'_, K, V>, StorageError>
fn range<'a, KR>( &self, range: impl RangeBounds<KR> + 'a ) -> Result<Range<'_, K, V>, StorageError>
Returns a double-ended iterator over a range of elements in the table Read more
source§fn first(
&self
) -> Result<Option<(AccessGuard<'_, K>, AccessGuard<'_, V>)>, StorageError>
fn first( &self ) -> Result<Option<(AccessGuard<'_, K>, AccessGuard<'_, V>)>, StorageError>
Returns the first key-value pair in the table, if it exists
source§fn last(
&self
) -> Result<Option<(AccessGuard<'_, K>, AccessGuard<'_, V>)>, StorageError>
fn last( &self ) -> Result<Option<(AccessGuard<'_, K>, AccessGuard<'_, V>)>, StorageError>
Returns the last key-value pair in the table, if it exists
source§impl<K: Key + 'static, V: Value + 'static> ReadableTableMetadata for ReadOnlyTable<K, V>
impl<K: Key + 'static, V: Value + 'static> ReadableTableMetadata for ReadOnlyTable<K, V>
source§fn stats(&self) -> Result<TableStats, StorageError>
fn stats(&self) -> Result<TableStats, StorageError>
Retrieves information about storage usage for the table
Auto Trait Implementations§
impl<K, V> Freeze for ReadOnlyTable<K, V>
impl<K, V> !RefUnwindSafe for ReadOnlyTable<K, V>
impl<K, V> Send for ReadOnlyTable<K, V>
impl<K, V> Sync for ReadOnlyTable<K, V>
impl<K, V> Unpin for ReadOnlyTable<K, V>
impl<K, V> !UnwindSafe for ReadOnlyTable<K, V>
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