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

pub struct Ready {
    pub committed_entries: Option<Vec<Entry>>,
    pub messages: Vec<Message>,
    // some fields omitted
}

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

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.

Methods

impl Ready[src]

pub fn ss(&self) -> Option<&SoftState>[src]

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.

pub fn hs(&self) -> Option<&HardState>[src]

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.

pub fn read_states(&self) -> &[ReadState][src]

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.

pub fn entries(&self) -> &[Entry][src]

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

pub fn snapshot(&self) -> &Snapshot[src]

Snapshot specifies the snapshot to be saved to stable storage.

pub fn must_sync(&self) -> bool[src]

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

Trait Implementations

impl Default for Ready[src]

impl PartialEq<Ready> for Ready[src]

impl Debug for Ready[src]

Auto Trait Implementations

impl Sync for Ready

impl Send for Ready

impl Unpin for Ready

impl RefUnwindSafe for Ready

impl UnwindSafe 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]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,