pub struct ScheduledTask {
pub deadline: Instant,
pub sequence: usize,
pub state: Arc<AtomicU8>,
pub task: Option<Box<dyn FnOnce() + Send + 'static>>,
}Expand description
Task stored in the delayed scheduler heap.
Fields§
§deadline: InstantTime at which this task becomes runnable.
sequence: usizeInsertion order used to make equal deadlines deterministic.
state: Arc<AtomicU8>Shared task state observed by cancellation handles.
task: Option<Box<dyn FnOnce() + Send + 'static>>Scheduled action.
Implementations§
Trait Implementations§
Source§impl Ord for ScheduledTask
impl Ord for ScheduledTask
Source§fn cmp(&self, other: &Self) -> CompareOrdering
fn cmp(&self, other: &Self) -> CompareOrdering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ScheduledTask
impl PartialEq for ScheduledTask
Source§impl PartialOrd for ScheduledTask
impl PartialOrd for ScheduledTask
impl Eq for ScheduledTask
Auto Trait Implementations§
impl Freeze for ScheduledTask
impl !RefUnwindSafe for ScheduledTask
impl Send for ScheduledTask
impl !Sync for ScheduledTask
impl Unpin for ScheduledTask
impl UnsafeUnpin for ScheduledTask
impl !UnwindSafe for ScheduledTask
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