pub struct Closure<F, R> { /* private fields */ }Expand description
A simple closure-based task implementation.
Implementations§
Trait Implementations§
Source§impl<F, R> Task for Closure<F, R>
impl<F, R> Task for Closure<F, R>
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<F, R> Freeze for Closure<F, R>
impl<F, R> RefUnwindSafe for Closure<F, R>where
BaseTask<F, R>: RefUnwindSafe,
impl<F, R> Send for Closure<F, R>
impl<F, R> Sync for Closure<F, R>
impl<F, R> Unpin for Closure<F, R>
impl<F, R> UnsafeUnpin for Closure<F, R>where
BaseTask<F, R>: UnsafeUnpin,
impl<F, R> UnwindSafe for Closure<F, R>where
BaseTask<F, R>: 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.