pub trait ReadTransaction<'db>: Sized {
type Cursor<'txn, T: Table>: ReadCursor<'txn, T>
where Self: 'txn;
type DupCursor<'txn, T: DupTable>: ReadCursor<'txn, T> + DupReadCursor<'txn, T>
where Self: 'txn;
// Required methods
fn get<T: Table>(&self, table: &T, key: &T::Key) -> Option<T::Value>;
fn cursor<'txn, T: RegularTable>(
&'txn self,
table: &T,
) -> Self::Cursor<'txn, T>;
fn dup_cursor<'txn, T: DupTable>(
&'txn self,
table: &T,
) -> Self::DupCursor<'txn, T>;
// Provided method
fn close(self) { ... }
}Expand description
Read-transactions can only perform read operations on a database.
Required Associated Types§
type Cursor<'txn, T: Table>: ReadCursor<'txn, T> where Self: 'txn
type DupCursor<'txn, T: DupTable>: ReadCursor<'txn, T> + DupReadCursor<'txn, T> where Self: 'txn
Required Methods§
Sourcefn get<T: Table>(&self, table: &T, key: &T::Key) -> Option<T::Value>
fn get<T: Table>(&self, table: &T, key: &T::Key) -> Option<T::Value>
Gets the value at a given key.
Sourcefn cursor<'txn, T: RegularTable>(&'txn self, table: &T) -> Self::Cursor<'txn, T>
fn cursor<'txn, T: RegularTable>(&'txn self, table: &T) -> Self::Cursor<'txn, T>
Creates a cursor for iterating over the table.
Sourcefn dup_cursor<'txn, T: DupTable>(
&'txn self,
table: &T,
) -> Self::DupCursor<'txn, T>
fn dup_cursor<'txn, T: DupTable>( &'txn self, table: &T, ) -> Self::DupCursor<'txn, T>
Creates a cursor for iterating over the table with duplicate keys.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.