raft_log/api/
state_machine.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::fmt::Debug;

use codeq::Segment;

use crate::ChunkId;

pub trait StateMachine<R> {
    type Error: std::error::Error + Debug + 'static;

    fn apply(
        &mut self,
        record: &R,
        chunk_id: ChunkId,
        segment: Segment,
    ) -> Result<(), Self::Error>;
}