pub trait DbTx: Send + Sync {
type Cursor<T: Table>: DbCursorRO<T> + Send + Sync;
type DupCursor<T: DupSort>: DbDupCursorRO<T> + DbCursorRO<T> + Send + Sync;
// Required methods
fn get<T: Table>(
&self,
key: T::Key,
) -> Result<Option<T::Value>, DatabaseError>;
fn commit(self) -> Result<bool, DatabaseError>;
fn abort(self);
fn cursor_read<T: Table>(&self) -> Result<Self::Cursor<T>, DatabaseError>;
fn cursor_dup_read<T: DupSort>(
&self,
) -> Result<Self::DupCursor<T>, DatabaseError>;
fn entries<T: Table>(&self) -> Result<usize, DatabaseError>;
fn disable_long_read_transaction_safety(&mut self);
}
Expand description
Read only transaction
Required Associated Types§
Sourcetype DupCursor<T: DupSort>: DbDupCursorRO<T> + DbCursorRO<T> + Send + Sync
type DupCursor<T: DupSort>: DbDupCursorRO<T> + DbCursorRO<T> + Send + Sync
DupCursor
type for this read-only transaction
Required Methods§
Sourcefn commit(self) -> Result<bool, DatabaseError>
fn commit(self) -> Result<bool, DatabaseError>
Commit for read only transaction will consume and free transaction and allows freeing of memory pages
Sourcefn cursor_read<T: Table>(&self) -> Result<Self::Cursor<T>, DatabaseError>
fn cursor_read<T: Table>(&self) -> Result<Self::Cursor<T>, DatabaseError>
Iterate over read only values in table.
Sourcefn cursor_dup_read<T: DupSort>(
&self,
) -> Result<Self::DupCursor<T>, DatabaseError>
fn cursor_dup_read<T: DupSort>( &self, ) -> Result<Self::DupCursor<T>, DatabaseError>
Iterate over read only values in dup sorted table.
Sourcefn entries<T: Table>(&self) -> Result<usize, DatabaseError>
fn entries<T: Table>(&self) -> Result<usize, DatabaseError>
Returns number of entries in the table.
Sourcefn disable_long_read_transaction_safety(&mut self)
fn disable_long_read_transaction_safety(&mut self)
Disables long-lived read transaction safety guarantees.
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.