pub struct Task<T> {
pub payload: T,
pub enqueue_ts: Instant,
pub deadline: Option<Instant>,
pub priority: Priority,
pub cost: u64,
}Expand description
Enqueued unit of work.
Fields§
§payload: TUser payload.
enqueue_ts: InstantEnqueue timestamp used to compute queue time metrics.
deadline: Option<Instant>Optional deadline for expiration before execution.
priority: PriorityPriority queue used for dispatch ordering.
cost: u64Cost consumed by DRR when this task is dequeued.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Task<T>where
T: Freeze,
impl<T> RefUnwindSafe for Task<T>where
T: RefUnwindSafe,
impl<T> Send for Task<T>where
T: Send,
impl<T> Sync for Task<T>where
T: Sync,
impl<T> Unpin for Task<T>where
T: Unpin,
impl<T> UnwindSafe for Task<T>where
T: UnwindSafe,
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