pub struct SmData<C: RaftTypeConfig<NodeId = NodeId>, S> {
pub last_applied_log: Option<LogId<NodeId>>,
pub last_membership: StoredMembership<NodeId, C::Node>,
pub state: S,
pub current_snapshot: Option<StoredSnapshot<C>>,
}Expand description
Internal state-machine data protected by a RwLock.
The generic parameter S is the application’s state type. It must be
Default + Clone + serde::Serialize + serde::de::DeserializeOwned.
Fields§
§last_applied_log: Option<LogId<NodeId>>Last applied log id.
last_membership: StoredMembership<NodeId, C::Node>Last membership config.
state: SApplication-specific state.
current_snapshot: Option<StoredSnapshot<C>>Current snapshot bytes (serialized S), if any.
Trait Implementations§
Auto Trait Implementations§
impl<C, S> Freeze for SmData<C, S>where
S: Freeze,
impl<C, S> RefUnwindSafe for SmData<C, S>
impl<C, S> Send for SmData<C, S>where
S: Send,
impl<C, S> Sync for SmData<C, S>where
S: Sync,
impl<C, S> Unpin for SmData<C, S>where
S: Unpin,
impl<C, S> UnsafeUnpin for SmData<C, S>where
S: UnsafeUnpin,
impl<C, S> UnwindSafe for SmData<C, S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more