pub struct DueNowResult {
pub deadlines: Vec<Deadline>,
pub has_more: bool,
}Expand description
Result of a DeadlineStore::due_now poll.
When has_more is true, the store has additional expired deadlines beyond
the returned deadlines. The scheduler should drain in a loop until
has_more is false to avoid leaving unfired deadlines in the store.
let store = InMemoryDeadlineStore::new();
loop {
let result = store.due_now(50).await.unwrap();
for deadline in result.deadlines {
// dispatch TimeoutDeadline command …
store.cancel(deadline.deadline_id()).await.unwrap();
}
if !result.has_more { break; }
}Fields§
§deadlines: Vec<Deadline>Expired deadlines, ordered soonest-first.
has_more: booltrue when the store contains more expired deadlines beyond deadlines.
Trait Implementations§
Source§impl Clone for DueNowResult
impl Clone for DueNowResult
Source§fn clone(&self) -> DueNowResult
fn clone(&self) -> DueNowResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DueNowResult
impl RefUnwindSafe for DueNowResult
impl Send for DueNowResult
impl Sync for DueNowResult
impl Unpin for DueNowResult
impl UnsafeUnpin for DueNowResult
impl UnwindSafe for DueNowResult
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