[−][src]Struct raftlog::log::LogSuffix
ログの後半部分.
厳密には、常に"後半部分"、つまり「ある地点より後ろの全てのエントリ」を 含んでいる訳ではない.
ただし、このデータ構造自体は、常に追記的なアクセスのために利用され、
"ログの途中の一部だけを更新する"といった操作は発生しないので、
"常にログの末尾に対して適用される"的な意味合いで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]
ⓘImportant traits for LogPositions<'a>
後半部分に含まれるエントリの位置を走査するためのイテレータを返す.
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_tail
がLogSuffix
が保持する範囲の外の場合には、
ErrorKind::InvalidInput
を理由としたエラーが返される.
pub fn slice(&self, start: LogIndex, end: LogIndex) -> Result<Self>
[src]
Trait Implementations
impl Default for LogSuffix
[src]
impl From<LogSuffix> for Log
[src]
impl Clone for LogSuffix
[src]
fn clone(&self) -> 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
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,