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>
pub fn get<'a>( &self, key: impl Borrow<K::SelfType<'a>>, ) -> Result<Option<AccessGuard<'static, V>>>
sourcepub fn range<'a, KR>(
&self,
range: impl RangeBounds<KR>,
) -> Result<Range<'static, K, V>>
pub fn range<'a, KR>( &self, range: impl RangeBounds<KR>, ) -> Result<Range<'static, K, V>>
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>>>
fn get<'a>( &self, key: impl Borrow<K::SelfType<'a>>, ) -> Result<Option<AccessGuard<'_, V>>>
Returns the value corresponding to the given key
source§fn range<'a, KR>(
&self,
range: impl RangeBounds<KR> + 'a,
) -> Result<Range<'_, K, V>>
fn range<'a, KR>( &self, range: impl RangeBounds<KR> + 'a, ) -> Result<Range<'_, K, V>>
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>)>>
fn first(&self) -> Result<Option<(AccessGuard<'_, K>, AccessGuard<'_, V>)>>
Returns the first key-value pair in the table, if it exists
source§fn last(&self) -> Result<Option<(AccessGuard<'_, K>, AccessGuard<'_, V>)>>
fn last(&self) -> Result<Option<(AccessGuard<'_, K>, AccessGuard<'_, V>)>>
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>
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