struct PacemakerState {
timeouts: BTreeMap<ViewNumber, Instant>,
timeout_vote_collectors: ActiveCollectorPair<TimeoutVoteCollector>,
last_advance_view: Option<ViewNumber>,
}
Expand description
Internal state of the Pacemaker
. Keeps track of the timeouts allocated to current and future views
(if any), and the timeout votes collected for the current view.
Fields§
§timeouts: BTreeMap<ViewNumber, Instant>
§timeout_vote_collectors: ActiveCollectorPair<TimeoutVoteCollector>
§last_advance_view: Option<ViewNumber>
Implementations§
source§impl PacemakerState
impl PacemakerState
sourcefn initialize(
config: &PacemakerConfiguration,
init_view: ViewNumber,
validator_set_state: &ValidatorSetState,
) -> Self
fn initialize( config: &PacemakerConfiguration, init_view: ViewNumber, validator_set_state: &ValidatorSetState, ) -> Self
Initializes the PacemakerState
on starting the protocol. Should only be called at the start of
the protocol.
sourcefn initial_timeouts(
start_view: ViewNumber,
config: &PacemakerConfiguration,
) -> BTreeMap<ViewNumber, Instant>
fn initial_timeouts( start_view: ViewNumber, config: &PacemakerConfiguration, ) -> BTreeMap<ViewNumber, Instant>
Return initial timeouts on starting the protocol from a given start view.
sourcefn set_timeouts(
&mut self,
start_view: ViewNumber,
config: &PacemakerConfiguration,
)
fn set_timeouts( &mut self, start_view: ViewNumber, config: &PacemakerConfiguration, )
Set the timeout for each view in the epoch starting from a given view.
sourcefn extend_epoch_view_timeout(
&mut self,
epoch_view: ViewNumber,
config: &PacemakerConfiguration,
)
fn extend_epoch_view_timeout( &mut self, epoch_view: ViewNumber, config: &PacemakerConfiguration, )
Extend the timeout of the epoch-change view by another max_view_time.
Required: The caller must ensure that the view is an epoch-change view.
Auto Trait Implementations§
impl Freeze for PacemakerState
impl RefUnwindSafe for PacemakerState
impl Send for PacemakerState
impl Sync for PacemakerState
impl Unpin for PacemakerState
impl UnwindSafe for PacemakerState
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