# TaskValueSource

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/data/core/plugins/struct-taskvaluesource/

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

```rust
struct TaskValueSource
```

The producer side of a [`TaskValue`](/docs/0.5.0/api/ferroui-base/data/core/plugins/struct-taskvalue/) that is not bound to a future: the
equivalent of a task completion source.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/task_stream_plugin.rs#L136)

## Members

- [`new`](#function-new)
- [`task`](#function-task)
- [`set_result`](#function-set_result)
- [`set_untyped_result`](#function-set_untyped_result)
- [`set_exception`](#function-set_exception)
- [`try_set_untyped_result`](#function-try_set_untyped_result)
- [`try_set_exception`](#function-try_set_exception)

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

### new

```rust
fn new() -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/task_stream_plugin.rs#L147)

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

### task

```rust
fn task(self: &Self) -> TaskValue
```

The task completed by this source.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/task_stream_plugin.rs#L152)

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

### set_result

```rust
fn set_result<T: PropertyValue>(self: &Self, value: T)
```

Completes the task with `value`. Panics if the task has already
finished.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/task_stream_plugin.rs#L158)

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

### set_untyped_result

```rust
fn set_untyped_result(self: &Self, value: Option<BoxedValue>)
```

Completes the task with an untyped value. Panics if the task has
already finished.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/task_stream_plugin.rs#L164)

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

### set_exception

```rust
fn set_exception(self: &Self, error: BindingError)
```

Fails the task with `error`. Panics if the task has already finished.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/task_stream_plugin.rs#L171)

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

### try_set_untyped_result

```rust
fn try_set_untyped_result(self: &Self, value: Option<BoxedValue>) -> bool
```

Completes the task with an untyped value unless it has already
finished.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/task_stream_plugin.rs#L179)

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

### try_set_exception

```rust
fn try_set_exception(self: &Self, error: BindingError) -> bool
```

Fails the task with `error` unless it has already finished.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/core/plugins/task_stream_plugin.rs#L184)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Default`

## Availability

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