[][src]Struct raft::raw_node::Ready

pub struct Ready {
    pub ss: Option<SoftState>,
    pub hs: Option<HardState>,
    pub read_states: Vec<ReadState>,
    pub entries: Vec<Entry>,
    pub snapshot: Snapshot,
    pub committed_entries: Option<Vec<Entry>>,
    pub messages: Vec<Message>,
    pub must_sync: bool,
}

Ready encapsulates the entries and messages that are ready to read, be saved to stable storage, committed or sent to other peers. All fields in Ready are read-only.

Fields

ss: Option<SoftState>

The current volatile state of a Node. SoftState will be nil if there is no update. It is not required to consume or store SoftState.

hs: Option<HardState>

The current state of a Node to be saved to stable storage BEFORE Messages are sent. HardState will be equal to empty state if there is no update.

read_states: Vec<ReadState>

States can be used for node to serve linearizable read requests locally when its applied index is greater than the index in ReadState. Note that the read_state will be returned when raft receives MsgReadIndex. The returned is only valid for the request that requested to read.

entries: Vec<Entry>

Entries specifies entries to be saved to stable storage BEFORE Messages are sent.

snapshot: Snapshot

Snapshot specifies the snapshot to be saved to stable storage.

committed_entries: Option<Vec<Entry>>

CommittedEntries specifies entries to be committed to a store/state-machine. These have previously been committed to stable store.

messages: Vec<Message>

Messages specifies outbound messages to be sent AFTER Entries are committed to stable storage. If it contains a MsgSnap message, the application MUST report back to raft when the snapshot has been received or has failed by calling ReportSnapshot.

must_sync: bool

MustSync indicates whether the HardState and Entries must be synchronously written to disk or if an asynchronous write is permissible.

Trait Implementations

impl PartialEq<Ready> for Ready[src]

impl Default for Ready[src]

impl Debug for Ready[src]

Auto Trait Implementations

impl Send for Ready

impl Sync for Ready

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]