Skip to main content

TxReadContext

Trait TxReadContext 

Source
pub trait TxReadContext {
    type Error;

    // Required methods
    fn with_read_raw<T>(
        &self,
        key: RecordKey,
        f: impl FnOnce(&[u8]) -> T,
    ) -> Result<Option<T>, Self::Error>;
    fn for_each_record_key(
        &self,
        kind: RecordKind,
        f: &mut dyn FnMut(RecordKey),
    );
}
Expand description

Read-only raw transaction capability used by typed convenience APIs.

Required Associated Types§

Source

type Error

Host error type.

Required Methods§

Source

fn with_read_raw<T>( &self, key: RecordKey, f: impl FnOnce(&[u8]) -> T, ) -> Result<Option<T>, Self::Error>

Reads a record by key.

Source

fn for_each_record_key(&self, kind: RecordKind, f: &mut dyn FnMut(RecordKey))

Iterates record keys for one record kind.

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§