openraft 0.10.0-alpha.18

Advanced Raft consensus
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::RaftTypeConfig;
#[cfg(doc)]
use crate::core::RaftCore;
use crate::type_config::alias::LogIdOf;

/// State for [`RaftCore`] that does not directly affect consensus.
///
/// Handles behavior not in [`Engine`](crate::engine::Engine), such as snapshot triggering and log
/// purging.
#[derive(Debug, Default, Clone)]
pub(crate) struct CoreState<C>
where C: RaftTypeConfig
{
    /// LogId of the last snapshot attempt.
    ///
    /// Prevents repeated attempts when the state machine declines to build a snapshot.
    pub(crate) snapshot_tried_at: Option<LogIdOf<C>>,
}