pub struct ReadOnlyTables<'db, 'txn> { /* private fields */ }
Expand description
A collection of read-only tables. Only read operations available through the ReadableTable
trait
are allowed.
Trait Implementations§
Source§impl<'db, 'txn> ReadableTable<'db, 'txn> for ReadOnlyTables<'db, 'txn>
impl<'db, 'txn> ReadableTable<'db, 'txn> for ReadOnlyTables<'db, 'txn>
type Table = ReadOnlyTable<'txn, &'static [u8], &'static [u8]>
type Transaction<'x> = ReadOnlyTransaction<'db>
fn open_table( &mut self, txn: &'txn Self::Transaction<'db>, table_name: &'static str, ) -> Result<()>
fn get_table(&self, table_name: &'static str) -> Option<&Self::Table>
Source§fn primary_get<T: SDBItem>(
&mut self,
txn: &'txn Self::Transaction<'db>,
key: &[u8],
) -> Result<Option<T>>
fn primary_get<T: SDBItem>( &mut self, txn: &'txn Self::Transaction<'db>, key: &[u8], ) -> Result<Option<T>>
Get a value from the table.
Returns
Ok(None)
if the key does not exist.
Available in Tables
and ReadOnlyTables
. Read moreSource§fn primary_iter<'a, T: SDBItem>(
&'a mut self,
txn: &'txn Self::Transaction<'db>,
) -> Result<PrimaryIterator<'_, 'txn, 'db, T>>where
'db: 'a,
'txn: 'a,
fn primary_iter<'a, T: SDBItem>(
&'a mut self,
txn: &'txn Self::Transaction<'db>,
) -> Result<PrimaryIterator<'_, 'txn, 'db, T>>where
'db: 'a,
'txn: 'a,
Source§fn primary_iter_range<'a, 'b, T>(
&'a mut self,
txn: &'txn Self::Transaction<'db>,
range_value: impl RangeBounds<&'a [u8]> + 'a,
) -> Result<PrimaryIterator<'_, 'txn, 'db, T>>where
T: SDBItem,
'db: 'a,
'txn: 'a,
fn primary_iter_range<'a, 'b, T>(
&'a mut self,
txn: &'txn Self::Transaction<'db>,
range_value: impl RangeBounds<&'a [u8]> + 'a,
) -> Result<PrimaryIterator<'_, 'txn, 'db, T>>where
T: SDBItem,
'db: 'a,
'txn: 'a,
Iterate over all the values of the table that are in the given range.
Available in
Tables
and ReadOnlyTables
. Read moreSource§fn primary_iter_start_with<'a, T>(
&'a mut self,
txn: &'txn Self::Transaction<'db>,
prefix_value: &'a [u8],
) -> Result<PrimaryIteratorStartWith<'_, 'txn, 'db, T>>where
T: SDBItem,
'db: 'a,
'txn: 'a,
fn primary_iter_start_with<'a, T>(
&'a mut self,
txn: &'txn Self::Transaction<'db>,
prefix_value: &'a [u8],
) -> Result<PrimaryIteratorStartWith<'_, 'txn, 'db, T>>where
T: SDBItem,
'db: 'a,
'txn: 'a,
Iterate over all the values of the table that start with the given prefix.
Available in
Tables
and ReadOnlyTables
. Read moreSource§fn secondary_get<T: SDBItem>(
&mut self,
txn: &'txn Self::Transaction<'db>,
key_def: impl KeyDefinition,
key: &[u8],
) -> Result<Option<T>>
fn secondary_get<T: SDBItem>( &mut self, txn: &'txn Self::Transaction<'db>, key_def: impl KeyDefinition, key: &[u8], ) -> Result<Option<T>>
Get a value from the table using a secondary key.
Returns
Ok(None)
if the key does not exist.
Available in Tables
and ReadOnlyTables
. Read moreSource§fn secondary_iter<'a, T: SDBItem>(
&mut self,
txn: &'txn Self::Transaction<'db>,
key_def: impl KeyDefinition,
) -> Result<SecondaryIterator<'_, 'txn, 'db, T, Self::Table>>
fn secondary_iter<'a, T: SDBItem>( &mut self, txn: &'txn Self::Transaction<'db>, key_def: impl KeyDefinition, ) -> Result<SecondaryIterator<'_, 'txn, 'db, T, Self::Table>>
Iterate over all the values of the table that start with the given prefix.
Available in
Tables
and ReadOnlyTables
. Read moreSource§fn secondary_iter_range<'a, 'b, T>(
&'a mut self,
txn: &'txn Self::Transaction<'db>,
key_def: impl KeyDefinition,
range_key: impl RangeBounds<&'b [u8]> + 'b,
) -> Result<SecondaryIterator<'_, 'txn, 'db, T, Self::Table>>where
T: SDBItem,
'a: 'b,
fn secondary_iter_range<'a, 'b, T>(
&'a mut self,
txn: &'txn Self::Transaction<'db>,
key_def: impl KeyDefinition,
range_key: impl RangeBounds<&'b [u8]> + 'b,
) -> Result<SecondaryIterator<'_, 'txn, 'db, T, Self::Table>>where
T: SDBItem,
'a: 'b,
Iterate over all the values of the table that start with the given prefix.
Available in
Tables
and ReadOnlyTables
. Read moreSource§fn secondary_iter_start_with<'a, 'b, T>(
&'a mut self,
txn: &'txn Self::Transaction<'db>,
key_def: impl KeyDefinition,
key_prefix: &'b [u8],
) -> Result<SecondaryIteratorStartWith<'a, 'txn, 'db, T, Self::Table>>where
T: SDBItem,
'b: 'a,
fn secondary_iter_start_with<'a, 'b, T>(
&'a mut self,
txn: &'txn Self::Transaction<'db>,
key_def: impl KeyDefinition,
key_prefix: &'b [u8],
) -> Result<SecondaryIteratorStartWith<'a, 'txn, 'db, T, Self::Table>>where
T: SDBItem,
'b: 'a,
Iterate over all the values of the table that start with the given prefix.
Available in
Tables
and ReadOnlyTables
. Read moreAuto Trait Implementations§
impl<'db, 'txn> Freeze for ReadOnlyTables<'db, 'txn>
impl<'db, 'txn> !RefUnwindSafe for ReadOnlyTables<'db, 'txn>
impl<'db, 'txn> Send for ReadOnlyTables<'db, 'txn>
impl<'db, 'txn> Sync for ReadOnlyTables<'db, 'txn>
impl<'db, 'txn> Unpin for ReadOnlyTables<'db, 'txn>
impl<'db, 'txn> !UnwindSafe for ReadOnlyTables<'db, 'txn>
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