Trait openraft::log_id::LogIndexOptionExt

source ·
pub trait LogIndexOptionExt {
    // Required methods
    fn next_index(&self) -> u64;
    fn prev_index(&self) -> Self;
    fn add(&self, v: u64) -> Self;
}
Expand description

This helper trait extracts information from an Option<LogIndex>.

In openraft, LogIndex is a u64.

Required Methods§

source

fn next_index(&self) -> u64

Return the next log index.

If self is None, it returns 0.

source

fn prev_index(&self) -> Self

Return the previous log index.

If self is None, it panics.

source

fn add(&self, v: u64) -> Self

Performs an “add” operation.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl LogIndexOptionExt for Option<u64>

source§

fn next_index(&self) -> u64

source§

fn prev_index(&self) -> Self

source§

fn add(&self, v: u64) -> Self

Implementors§