Skip to main content

IndexableOp

Trait IndexableOp 

Source
pub trait IndexableOp: Op {
    // Required methods
    fn to_index_entry(&self) -> Result<OpIndexEntry, CodecError>;
    fn from_index_parts(
        tag: u8,
        key: &[u8],
        value: &[u8],
    ) -> Result<Self, CodecError>;
}
Expand description

An Op that can also be split into an indexable (tag, key, value) triple for the SQL op-log. key is the indexable identity (such as table + primary key). value is the op’s remaining payload.

§Round-trip

from_index_parts must invert to_index_entry, so the full op can be reconstructed from its stored parts.

Required Methods§

Source

fn to_index_entry(&self) -> Result<OpIndexEntry, CodecError>

Split self into its (tag, key, value) triple.

Source

fn from_index_parts( tag: u8, key: &[u8], value: &[u8], ) -> Result<Self, CodecError>

Reconstruct an op from a stored triple. The inverse of to_index_entry.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§