Skip to main content

FixedEngineAccess

Trait FixedEngineAccess 

Source
pub trait FixedEngineAccess:
    Send
    + Sync
    + 'static {
    // Required methods
    fn shard_count(&self) -> usize;
    fn key_len(&self) -> usize;
    fn value_len(&self) -> usize;
    fn slot_size(&self) -> u16;
    fn current_slot_count(&self, shard_id: usize) -> u32;
    fn shard_prefix_bits(&self) -> u8;
    fn read_shard_chunk(
        &self,
        shard_id: usize,
        start_slot: u32,
        count: usize,
    ) -> DbResult<Vec<u8>>;
    fn install_replication_producers(
        &self,
        producers: Vec<Producer<FixedReplicationEvent>>,
    );
    fn update_min_replicated_version(&self, shard_id: usize, version: u32);

    // Provided method
    fn take_dropped(&self, _shard_id: usize) -> bool { ... }
}

Required Methods§

Source

fn shard_count(&self) -> usize

Source

fn key_len(&self) -> usize

Source

fn value_len(&self) -> usize

Source

fn slot_size(&self) -> u16

Source

fn current_slot_count(&self, shard_id: usize) -> u32

Source

fn shard_prefix_bits(&self) -> u8

Source

fn read_shard_chunk( &self, shard_id: usize, start_slot: u32, count: usize, ) -> DbResult<Vec<u8>>

Read a contiguous chunk of count slots starting at start_slot into a fresh Vec. Byte length = count * slot_size.

Source

fn install_replication_producers( &self, producers: Vec<Producer<FixedReplicationEvent>>, )

Install SPSC producers into shards (lazy on first follower).

Source

fn update_min_replicated_version(&self, shard_id: usize, version: u32)

Hint for monitoring — follower Acked this version. Used only for metrics.

Provided Methods§

Source

fn take_dropped(&self, _shard_id: usize) -> bool

Read-and-clear the per-shard “events dropped” flag. Set by the leader’s write path when it could not push a mutation into the SPSC ring (ring overflow while Phase-1 blocked, or a write burst). When it returns true the Phase-2 server tells the follower to reconnect and re-run Phase-1 so the full scan reconciles the gap. Defaults to false so mock engines stay source-compatible.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§