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]

[src]

Trait Implementations

impl Debug for FsLog
[src]

[src]

Formats the value using the given formatter. Read more

impl Log for FsLog
[src]

[src]

Returns the latest known term.

[src]

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

[src]

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

[src]

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

[src]

Sets the candidate id voted for in the current term.

[src]

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

[src]

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

[src]

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

[src]

Append entries sent from the leader.

impl Clone for FsLog
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for FsLog

impl Sync for FsLog