pub struct Task(/* private fields */);Expand description
A V8 foreground task. Ownership is transferred from C++ to Rust when
V8 posts a task via PlatformImpl trait methods.
The embedder is responsible for scheduling the task and calling
run(). For example, in an async runtime like tokio:
ⓘ
tokio::spawn(async move { task.run() });If dropped without calling run(), the task is destroyed without
executing.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl !Sync for Task
impl Unpin for Task
impl UnsafeUnpin for Task
impl UnwindSafe for Task
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