Struct ReadOnlyTables

Source
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>

Source§

type Table = ReadOnlyTable<'txn, &'static [u8], &'static [u8]>

Source§

type Transaction<'x> = ReadOnlyTransaction<'db>

Source§

fn open_table( &mut self, txn: &'txn Self::Transaction<'db>, table_name: &'static str, ) -> Result<()>

Source§

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>>

Get a value from the table. Returns Ok(None) if the key does not exist. Available in Tables and ReadOnlyTables. Read more
Source§

fn primary_iter<'a, T: SDBItem>( &'a mut self, txn: &'txn Self::Transaction<'db>, ) -> Result<PrimaryIterator<'_, 'txn, 'db, T>>
where 'db: 'a, 'txn: 'a,

Iterate over all the values of the table. Available in Tables and ReadOnlyTables. Read more
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,

Iterate over all the values of the table that are in the given range. Available in Tables and ReadOnlyTables. Read more
Source§

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 more
Source§

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 more
Source§

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 more
Source§

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 more
Source§

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 more
Source§

fn len<T: SDBItem>(&mut self, txn: &'txn Self::Transaction<'db>) -> Result<u64>

Returns the number of elements in the table. Available in Tables and ReadOnlyTables. Read more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.