pub struct Ready { /* private fields */ }
Expand description
Ready encapsulates the entries and messages that are ready to read, be saved to stable storage, committed or sent to other peers.
Implementations§
source§impl Ready
impl Ready
sourcepub fn number(&self) -> u64
pub fn number(&self) -> u64
The number of current Ready. It is used for identifying the different Ready and ReadyRecord.
sourcepub fn ss(&self) -> Option<&SoftState>
pub fn ss(&self) -> Option<&SoftState>
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.
sourcepub fn hs(&self) -> Option<&HardState>
pub fn hs(&self) -> Option<&HardState>
The current state of a Node to be saved to stable storage. HardState will be None state if there is no update.
sourcepub fn read_states(&self) -> &Vec<ReadState> ⓘ
pub fn read_states(&self) -> &Vec<ReadState> ⓘ
ReadStates specifies the state for read only query.
sourcepub fn take_read_states(&mut self) -> Vec<ReadState> ⓘ
pub fn take_read_states(&mut self) -> Vec<ReadState> ⓘ
Take the ReadStates.
sourcepub fn entries(&self) -> &Vec<Entry> ⓘ
pub fn entries(&self) -> &Vec<Entry> ⓘ
Entries specifies entries to be saved to stable storage.
sourcepub fn take_entries(&mut self) -> Vec<Entry> ⓘ
pub fn take_entries(&mut self) -> Vec<Entry> ⓘ
Take the Entries.
sourcepub fn snapshot(&self) -> &Snapshot
pub fn snapshot(&self) -> &Snapshot
Snapshot specifies the snapshot to be saved to stable storage.
sourcepub fn committed_entries(&self) -> &Vec<Entry> ⓘ
pub fn committed_entries(&self) -> &Vec<Entry> ⓘ
CommittedEntries specifies entries to be committed to a store/state-machine. These have previously been committed to stable store.
sourcepub fn take_committed_entries(&mut self) -> Vec<Entry> ⓘ
pub fn take_committed_entries(&mut self) -> Vec<Entry> ⓘ
Take the CommitEntries.
sourcepub fn messages(&self) -> &[Message]
pub fn messages(&self) -> &[Message]
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.
sourcepub fn take_messages(&mut self) -> Vec<Message> ⓘ
pub fn take_messages(&mut self) -> Vec<Message> ⓘ
Take the Messages.
sourcepub fn persisted_messages(&self) -> &[Message]
pub fn persisted_messages(&self) -> &[Message]
Persisted Messages specifies outbound messages to be sent AFTER the HardState, Entries and Snapshot are persisted to stable storage.
sourcepub fn take_persisted_messages(&mut self) -> Vec<Message> ⓘ
pub fn take_persisted_messages(&mut self) -> Vec<Message> ⓘ
Take the Persisted Messages.
sourcepub fn must_sync(&self) -> bool
pub fn must_sync(&self) -> bool
MustSync is false if and only if
- no HardState or only its commit is different from before
- no Entries and Snapshot
If it’s false, an asynchronous write of HardState is permissible before calling
RawNode::on_persist_ready
orRawNode::advance
or its families.