pub enum Key {
Entry(Index),
TermVote,
CommitIndex,
SnapshotMeta,
SnapshotData,
}Expand description
日志存储键。
编码为固定前缀 + 可选的大端索引,保证 Entry(i) 按索引字典序排列,
且全部 Entry 键排在元数据键之前:
Entry(index)→[0x00] ‖ index.to_be_bytes()TermVote→[0x01]CommitIndex→[0x02]SnapshotMeta→[0x03](last_included_index, last_included_term)SnapshotData→[0x04]状态机快照字节
Variants§
Entry(Index)
日志条目,保存任期与命令。
TermVote
保存当前任期与投票(若有)。
CommitIndex
保存当前 commit 索引(若有)。
SnapshotMeta
快照元数据:(last_included_index, last_included_term)。
SnapshotData
状态机快照原始字节。
Implementations§
Trait Implementations§
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more