reth_db_api::transaction

Trait DbTxMut

Source
pub trait DbTxMut: Send + Sync {
    type CursorMut<T: Table>: DbCursorRW<T> + DbCursorRO<T> + Send + Sync;
    type DupCursorMut<T: DupSort>: DbDupCursorRW<T> + DbCursorRW<T> + DbDupCursorRO<T> + DbCursorRO<T> + Send + Sync;

    // Required methods
    fn put<T: Table>(
        &self,
        key: T::Key,
        value: T::Value,
    ) -> Result<(), DatabaseError>;
    fn delete<T: Table>(
        &self,
        key: T::Key,
        value: Option<T::Value>,
    ) -> Result<bool, DatabaseError>;
    fn clear<T: Table>(&self) -> Result<(), DatabaseError>;
    fn cursor_write<T: Table>(
        &self,
    ) -> Result<Self::CursorMut<T>, DatabaseError>;
    fn cursor_dup_write<T: DupSort>(
        &self,
    ) -> Result<Self::DupCursorMut<T>, DatabaseError>;
}
Expand description

Read write transaction that allows writing to database

Required Associated Types§

Source

type CursorMut<T: Table>: DbCursorRW<T> + DbCursorRO<T> + Send + Sync

Read-Write Cursor type

Source

type DupCursorMut<T: DupSort>: DbDupCursorRW<T> + DbCursorRW<T> + DbDupCursorRO<T> + DbCursorRO<T> + Send + Sync

Read-Write DupCursor type

Required Methods§

Source

fn put<T: Table>( &self, key: T::Key, value: T::Value, ) -> Result<(), DatabaseError>

Put value to database

Source

fn delete<T: Table>( &self, key: T::Key, value: Option<T::Value>, ) -> Result<bool, DatabaseError>

Delete value from database

Source

fn clear<T: Table>(&self) -> Result<(), DatabaseError>

Clears database.

Source

fn cursor_write<T: Table>(&self) -> Result<Self::CursorMut<T>, DatabaseError>

Cursor mut

Source

fn cursor_dup_write<T: DupSort>( &self, ) -> Result<Self::DupCursorMut<T>, DatabaseError>

DupCursor mut.

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.

Implementors§