# TaskCanceledError

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-system/threading/tasks/struct-taskcancelederror/

**struct** · [`ferroui-system`](/docs/0.5.0/api/ferroui-system/) · v0.5.0

```rust
struct TaskCanceledError
```

The error of a canceled task that names it (`TaskCanceledException` with its `Task`).

A cancellation that names no task is [`Canceled`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-canceled/), the one cancellation error of the workspace
(docs/idiomatic-rust-async.md, section 3.7), which the new types give.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.System/threading/tasks/task.rs#L48)

> **Deprecated since 0.5.0.** use `ferroui_system::task::Canceled`, and `Canceled::is_cancellation` to recognize a cancellation

## Members

- [`task_id`](#struct_field-task_id)
- [`is_cancellation`](#function-is_cancellation)

<a id="struct_field-task_id"></a>

### task_id

```rust
task_id: Option<u64>
```

The id of the task, when the error names one (`TaskCanceledException.Task`).

> **Deprecated since 0.5.0.** use `ferroui_system::task::Canceled`, and `Canceled::is_cancellation` to recognize a cancellation

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.System/threading/tasks/task.rs#L50)

<a id="function-is_cancellation"></a>

### is_cancellation

```rust
fn is_cancellation(error: &ObservableError) -> bool
```

Whether `error` is a cancellation: a `Canceled` or a `TaskCanceledError`
(`Canceled::is_cancellation`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.System/threading/tasks/task.rs#L64)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ToString`
- `Clone`
- `Debug`
- `Default`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Display`
- [`Error`](/docs/0.5.0/api/ferroui-dynamic-data/kernel/struct-error/)
- `From<Canceled>`
- `From<TaskCanceledError>`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
