pub struct State {
pub attempts: u64,
pub next_attempt: u64,
}Expand description
State stored alongside the consumer’s candidate fingerprint.
Fields§
§attempts: u64Reserved attempts, including candidates that die immediately after commit.
next_attempt: u64Earliest permitted retry in the consumer’s persisted time domain (seconds).
Implementations§
Source§impl State
impl State
Sourcepub fn allowed(&self, policy: Policy, now: u64) -> bool
pub fn allowed(&self, policy: Policy, now: u64) -> bool
Whether this campaign may attempt a candidate now.
Sourcepub fn reserve(&mut self, policy: Policy, now: u64)
pub fn reserve(&mut self, policy: Policy, now: u64)
Reserve before launching. Persist the returned state before spawning; cancellation and controller crashes must not restore the spent attempt.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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