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

pub struct Ready { /* fields omitted */ }

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

Implementations

impl Ready[src]

pub fn number(&self) -> u64[src]

The number of current Ready. It is used for identifying the different Ready and ReadyRecord.

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

The current volatile state of a Node. SoftState will be None 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. HardState will be None state if there is no update.

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

ReadStates specifies the state for read only query.

pub fn take_read_states(&mut self) -> Vec<ReadState>[src]

Take the ReadStates.

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

Entries specifies entries to be saved to stable storage.

pub fn take_entries(&mut self) -> Vec<Entry>[src]

Take the Entries.

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

Snapshot specifies the snapshot to be saved to stable storage.

pub fn committed_entries(&self) -> &Vec<Entry>[src]

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

pub fn take_committed_entries(&mut self) -> Vec<Entry>[src]

Take the CommitEntries.

pub fn messages(&self) -> &[Message][src]

Messages specifies outbound messages to be sent. 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.

pub fn take_messages(&mut self) -> Vec<Message>[src]

Take the Messages.

pub fn persisted_messages(&self) -> &[Message][src]

Persisted Messages specifies outbound messages to be sent AFTER the HardState, Entries and Snapshot are persisted to stable storage.

pub fn take_persisted_messages(&mut self) -> Vec<Message>[src]

Take the Persisted Messages.

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

MustSync is false if and only if

  1. no HardState or only its commit is different from before
  2. no Entries and Snapshot If it’s false, an asynchronous write of HardState is permissible before calling on_persist_ready or advance or its families.

Trait Implementations

impl Debug for Ready[src]

impl Default for Ready[src]

impl PartialEq<Ready> for Ready[src]

impl StructuralPartialEq for Ready[src]

Auto Trait Implementations

impl RefUnwindSafe for Ready

impl Send for Ready

impl Sync for Ready

impl Unpin for Ready

impl UnwindSafe for Ready

Blanket Implementations

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

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

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

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

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

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[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<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]