pub struct Cadence { /* private fields */ }Expand description
When the next pulse is due.
Due once an interval, and early when the claim changes - a dashboard that learned about a break a minute late would be a minute wrong at exactly the moments it is looked at. A failed attempt holds that back: until the wait is over a change waits too, or a laptop on a train would try again at every pause.
Implementations§
Source§impl Cadence
impl Cadence
Sourcepub fn is_due(
&self,
now: Instant,
state: AgentState,
record_missing: bool,
) -> bool
pub fn is_due( &self, now: Instant, state: AgentState, record_missing: bool, ) -> bool
Whether to send now, claiming state.
record_missing is the pulse’s record found empty: nobody has reported
since the pulse was turned on, and the person who turned it on is
waiting to hear how it went.
Sourcepub fn sent(&mut self, now: Instant, state: AgentState, wait: Duration)
pub fn sent(&mut self, now: Instant, state: AgentState, wait: Duration)
Notes a pulse the server took.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cadence
impl RefUnwindSafe for Cadence
impl Send for Cadence
impl Sync for Cadence
impl Unpin for Cadence
impl UnsafeUnpin for Cadence
impl UnwindSafe for Cadence
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