Struct openraft::raft::RuntimeConfigHandle
source · pub struct RuntimeConfigHandle<'r, C>where
C: RaftTypeConfig,{ /* private fields */ }
Expand description
RuntimeConfigHandle is an interface to update runtime config.
These config are mainly designed for testing purpose and special use cases. Usually you don’t need to change runtime config.
Implementations§
source§impl<'r, C> RuntimeConfigHandle<'r, C>where
C: RaftTypeConfig,
impl<'r, C> RuntimeConfigHandle<'r, C>where
C: RaftTypeConfig,
sourcepub fn tick(&self, enabled: bool)
pub fn tick(&self, enabled: bool)
Enable or disable raft internal ticker.
Disabling tick will disable election and heartbeat.
sourcepub fn heartbeat(&self, enabled: bool)
pub fn heartbeat(&self, enabled: bool)
Enable or disable heartbeat message when a leader has no more log to replicate.
Note that the follower’s leader-lease will not be renewed if it does receive message from
the leader, and it will start election(if Self::elect()
is enabled) when the lease timed
out.
Auto Trait Implementations§
impl<'r, C> Freeze for RuntimeConfigHandle<'r, C>
impl<'r, C> !RefUnwindSafe for RuntimeConfigHandle<'r, C>
impl<'r, C> Send for RuntimeConfigHandle<'r, C>
impl<'r, C> Sync for RuntimeConfigHandle<'r, C>
impl<'r, C> Unpin for RuntimeConfigHandle<'r, C>
impl<'r, C> !UnwindSafe for RuntimeConfigHandle<'r, C>
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