Struct raft_consensus::persistent_log::fs::FsLog[][src]

pub struct FsLog { /* fields omitted */ }

Stores log on disk as 8 bytes for the version identifier, 8 bytes for current_term, 8 bytes for voted_for, and as much as needed for the log. Each log entry is stored as an 8 byte length specifier which is the total length of the entry in bytes, including the length specifier, followed by 8 bytes specifying the term, plus a variable length entry, which is the serialized command sent to raft by the client.

Methods

impl FsLog
[src]

Trait Implementations

impl Debug for FsLog
[src]

Formats the value using the given formatter. Read more

impl Log for FsLog
[src]

Returns the latest known term.

Sets the current term to the provided value. The provided term must be greater than the current term. The voted_for value will be reset. Read more

Increment the current term. The voted_for value will be reset.

Returns the candidate id of the candidate voted for in the current term (or none).

Sets the candidate id voted for in the current term.

Returns the index of the latest persisted log entry (0 if the log is empty).

Returns the term of the latest persisted log entry (0 if the log is empty).

Returns the term for the entry at the provided log index writing entry itself to writer if requested Read more

Append entries sent from the leader.

impl Clone for FsLog
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for FsLog

impl Sync for FsLog