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>
Source§impl<K: Key + 'static, V: Value + 'static> TableHandle for ReadOnlyTable<K, V>
impl<K: Key + 'static, V: Value + 'static> TableHandle 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