pub fn abort(&self) {
        if let Some(raw) = self.raw {
            raw.remote_abort();
        }
    }
/// Abort the task associated with the handle.
///
/// Awaiting a cancelled task might complete as usual if the task was
/// already completed at the time it was cancelled, but most likely it
/// will fail with a [cancelled] `JoinError`.
///
/// ```rust
/// use tokio::time;
///
/// #[tokio::main]
/// async fn main() {
///    let mut handles = Vec::new();
///
///    handles.push(tokio::spawn(async {
///       time::sleep(time::Duration::from_secs(10)).await;
///       true
///    }));
///
///    handles.push(tokio::spawn(async {
///       time::sleep(time::Duration::from_secs(10)).await;
///       false
///    }));
///
///    for handle in &handles {
///        handle.abort();
///    }
///
///    for handle in handles {
///        assert!(handle.await.unwrap_err().is_cancelled());
///    }
/// }
/// ```
/// [cancelled]: method@super::error::JoinError::is_cancelled
Abort the task associated with the handle.
Awaiting a cancelled task might complete as usual if the task was
already completed at the time it was cancelled, but most likely it
will fail with a [cancelled] `JoinError`.

```rust
use tokio::time.
Abort the task associated with the handle . Awaiting a cancelled task might complete as usual if the task was already completed at the time it was cancelled but most likely it will fail with a [ cancelled ] ` JoinError ` . ` ` ` rust use tokio :: time .
pub fn abort(&self) {
        if let Some(raw) = self.raw {
            raw.remote_abort();
        }
    }
pub fn abort ( & self ) { if let Some ( raw ) = self . raw { raw . remote_abort ( ) ; } }
Abort the task associated with the handle.
Abort the task associated with the handle .
&self
&self
[tokio::main]
async fn main() {
let mut handles = Vec::new().

handles.push(tokio::spawn(async {
time::sleep(time::Duration::from_secs(10)).await;
true
})).

handles.push(tokio::spawn(async {
time::sleep(time::Duration::from_secs(10)).await;
false
})).

for handle in &handles {
handle.abort();
}

for handle in handles {
assert!(handle.await.unwrap_err().is_cancelled());
}
}
```
[cancelled]: method@super::error::JoinError::is_cancelled
async fn main () { let mut handles = Vec :: new () . handles . push ( tokio :: spawn ( async { time :: sleep ( time :: Duration :: from_secs ( 10 )) . await ; true } )) . handles . push ( tokio :: spawn ( async { time :: sleep ( time :: Duration :: from_secs ( 10 )) . await ; false } )) . for handle in &handles { handle . abort () ; } for handle in handles { assert! ( handle . await . unwrap_err () . is_cancelled () ) ; } } ` ` ` [ cancelled ] : method@super :: error :: JoinError :: is_cancelled