Struct raft_consensus::persistent_log::mem::MemLog[][src]

pub struct MemLog { /* fields omitted */ }

This is a Log implementation that stores entries in a simple in-memory vector. Other data is stored in a struct. It is chiefly intended for testing.

Panic

No bounds checking is performed and attempted access to non-existing log indexes will panic.

Methods

impl MemLog
[src]

Trait Implementations

impl Clone for MemLog
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for MemLog
[src]

Formats the value using the given formatter. Read more

impl Log for MemLog
[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

Appends the provided entries to the log beginning at the given index.

impl Default for MemLog
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for MemLog

impl Sync for MemLog