pub struct Options {
pub heartbeat_interval: Ticks,
pub election_timeout_range: Range<Ticks>,
pub max_append_entries: usize,
pub pre_vote: bool,
pub check_quorum: bool,
pub snapshot_threshold: u64,
}Expand description
Raft 节点选项。
Fields§
§heartbeat_interval: Ticks领导者心跳之间的 tick 数。
election_timeout_range: Range<Ticks>跟随者与候选人的随机选举超时范围。
max_append_entries: usize单条 Append 消息中最多发送的条目数。
pre_vote: bool启用 Pre-vote:真选举前先确认多数,避免分区节点抬升任期。
check_quorum: bool启用 CheckQuorum:领导者在无法联系多数时下台。
snapshot_threshold: u64距上次快照 apply 了多少条后触发本地快照;0 表示关闭。
Trait Implementations§
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
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