pub enum Event {
RoleChanged {
new_role: Role,
},
TermChanged {
new_ballot: Ballot,
},
NewLeaderElected,
Committed {
index: LogIndex,
entry: LogEntry,
},
SnapshotLoaded {
new_head: LogPosition,
snapshot: Vec<u8>,
},
SnapshotInstalled {
new_head: LogPosition,
},
}Expand description
ReplicatedLogから発生するイベント一覧.
Variants§
RoleChanged
ローカルノードの役割が変わった.
TermChanged
新しい選挙期間に移った.
NewLeaderElected
新しいリーダーが選出された.
Committed
新しいログエントリがコミットされた.
エントリの内容がコマンドの場合には、
ReplicatedLogの利用者は、自身が管理する状態機械に、
commandを適用する必要がある.
ログエントリはインデックスの昇順でコミットされ, インデックスは常に一ずつ増加する.
SnapshotLoaded
スナップショットがロードされた.
ReplicatedLogの利用者は、自身が管理する状態機械を、
snapshotの状態にリセットする必要がある.
SnapshotInstalled
スナップショットのインストールが行われた.
もしnew_headの位置が、最新のコミット済み地点よりも
新しい場合には、これとは別にSnapshotLoadedイベントが発行される.
Fields
§
new_head: LogPositionTrait Implementations§
impl Eq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more