pub struct ContextualTask<T> { /* private fields */ }Expand description
A task with an explicit context.
Implementations§
Source§impl<T> ContextualTask<T>where
T: Task,
impl<T> ContextualTask<T>where
T: Task,
Sourcepub fn new(task: T, context: TaskContext) -> ContextualTask<T>
pub fn new(task: T, context: TaskContext) -> ContextualTask<T>
Create a new contextual task.
Trait Implementations§
Source§impl<T> Task for ContextualTask<T>where
T: Task,
impl<T> Task for ContextualTask<T>where
T: Task,
Source§fn context(&self) -> &TaskContext
fn context(&self) -> &TaskContext
Get the task context for scheduling and debugging.
Source§fn is_stealable(&self) -> bool
fn is_stealable(&self) -> bool
Check if this task can be stolen by another thread.
Source§fn estimated_cost(&self) -> u32
fn estimated_cost(&self) -> u32
Estimate the computational cost of this task (for load balancing).
Auto Trait Implementations§
impl<T> Freeze for ContextualTask<T>where
T: Freeze,
impl<T> RefUnwindSafe for ContextualTask<T>where
T: RefUnwindSafe,
impl<T> Send for ContextualTask<T>where
T: Send,
impl<T> Sync for ContextualTask<T>where
T: Sync,
impl<T> Unpin for ContextualTask<T>where
T: Unpin,
impl<T> UnsafeUnpin for ContextualTask<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ContextualTask<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
Source§impl<T> TaskExt for Twhere
T: Task,
impl<T> TaskExt for Twhere
T: Task,
Source§fn with_context(self, context: TaskContext) -> ContextualTask<Self>
fn with_context(self, context: TaskContext) -> ContextualTask<Self>
Convert this task into a task with the given context.