Skip to main content

Handle

Trait Handle 

Source
pub trait Handle<T>: Future<Output = T>
where T: 'static,
{ // Required method fn detach(self); }
Expand description

Task handle trait.

This handle is used to receive result from the task, as well as controlling the task like cancelling and detaching it:

  • Awaiting this handle receives the result.
  • Dropping this handle cancels the task.
  • Calling detach consumes and detaches the task.

Required Methods§

Source

fn detach(self)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§