pub struct Task<I, C = ()> { /* private fields */ }Expand description
Task.
Tasks are intended to be run by an Executor, providing a convenient
way to encapsulate functionality that doesn’t require shared state, moving
it to a worker thread for parallel execution. Tasks can capture variables
from their environment, and are designed to be executed once.
The given parameter C captures a specific type used during scheduling, in
order to pass type information through a chain of effects inside of actions.
When registering actions, the scheduler will erase the type information, as
it’s only necessary during compile time, not during execution.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<I, C = ()> !RefUnwindSafe for Task<I, C>
impl<I, C = ()> !Sync for Task<I, C>
impl<I, C = ()> !UnwindSafe for Task<I, C>
impl<I, C> Freeze for Task<I, C>
impl<I, C> Send for Task<I, C>
impl<I, C> Unpin for Task<I, C>
impl<I, C> UnsafeUnpin for Task<I, C>
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