pub struct RaftConfig {
pub election_timeout_min: Duration,
pub election_timeout_max: Duration,
pub heartbeat_interval: Duration,
pub max_entries_per_request: usize,
pub snapshot_threshold: u64,
pub lease_duration: Duration,
}Expand description
Configuration for the Raft consensus algorithm.
Fields§
§election_timeout_min: Duration§election_timeout_max: Duration§heartbeat_interval: Duration§max_entries_per_request: usize§snapshot_threshold: u64§lease_duration: DurationDuration for which a leader lease is valid after receiving majority acks. Should be slightly longer than heartbeat_interval to avoid flapping.
Implementations§
Source§impl RaftConfig
impl RaftConfig
pub fn new() -> Self
pub fn with_election_timeout(self, min: Duration, max: Duration) -> Self
pub fn with_heartbeat_interval(self, interval: Duration) -> Self
Trait Implementations§
Source§impl Clone for RaftConfig
impl Clone for RaftConfig
Source§fn clone(&self) -> RaftConfig
fn clone(&self) -> RaftConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RaftConfig
impl Debug for RaftConfig
Auto Trait Implementations§
impl Freeze for RaftConfig
impl RefUnwindSafe for RaftConfig
impl Send for RaftConfig
impl Sync for RaftConfig
impl Unpin for RaftConfig
impl UnsafeUnpin for RaftConfig
impl UnwindSafe for RaftConfig
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