[][src]Struct raftlog::log::LogSuffix

pub struct LogSuffix {
    pub head: LogPosition,
    pub entries: Vec<LogEntry>,
}

ログの後半部分.

厳密には、常に"後半部分"、つまり「ある地点より後ろの全てのエントリ」を 含んでいる訳ではない.

ただし、このデータ構造自体は、常に追記的なアクセスのために利用され、 "ログの途中の一部だけを更新する"といった操作は発生しないので、 "常にログの末尾に対して適用される"的な意味合いでSuffixと付けている.

Fields

head: LogPosition

ログの開始位置.

entriesのサイズが1以上の場合には、 その最初のエントリの位置となる.

entries: Vec<LogEntry>

後半部分に属するエントリ群.

Methods

impl LogSuffix[src]

pub fn tail(&self) -> LogPosition[src]

ログの終端位置を返す.

"終端位置" = "entriesに含まれない最初のエントリの位置".

entriesの最後の要素が、ログ全体の最後の要素と一致している場合には、 "終端位置"は「次にログに追加される位置(= ログの末端)」となる.

Important traits for LogPositions<'a>
pub fn positions(&self) -> LogPositions[src]

後半部分に含まれるエントリの位置を走査するためのイテレータを返す.

pub fn skip_to(&mut self, new_head: LogIndex) -> Result<()>[src]

new_headのまでスキップする.

現在の先頭からnew_headまでのエントリは破棄され、new_headが新しい先頭になる.

Errors

以下のいずれかの場合にはErrorKind::InvalidInputが返される:

  • new_head < self.head.index
  • self.tail().index < new_head

pub fn truncate(&mut self, new_tail: LogIndex) -> Result<()>[src]

終端をnew_tailの位置まで切り詰める.

Errors

new_tailLogSuffixが保持する範囲の外の場合には、 ErrorKind::InvalidInputを理由としたエラーが返される.

pub fn slice(&self, start: LogIndex, end: LogIndex) -> Result<Self>[src]

指定された範囲のログ領域を切り出して返す.

Errors

selfが指定範囲を包含していない場合には、 ErrorKind::InvalidInputを理由としてエラーが返される.

Trait Implementations

impl Default for LogSuffix[src]

impl From<LogSuffix> for Log[src]

impl Clone for LogSuffix[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for LogSuffix[src]

Auto Trait Implementations

impl Send for LogSuffix

impl Sync for LogSuffix

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]