# spawn_local_on_result

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-system/task/function-spawn_local_on_result/

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

```rust
fn spawn_local_on_result<F, T>(future: F, schedule: std::sync::Arc<dyn Schedule>, first_poll: super::schedule::FirstPoll) -> super::join::JoinHandle<T>
where F: Future<Output = Result<T, super::join::JoinError>> + 'static,
      T: 'static
```

Runs `future` as a task of the current thread whose polls run on `schedule`, as
[`spawn_local_on`](/docs/0.5.0/api/ferroui-system/task/function-spawn_local_on/), and gives a handle whose outcome is the output of the future: `Ok(value)`
is the value of the task, and `Err(error)` ends the task with `error`, as if it had been
aborted (`JoinError::Canceled`) or had panicked (`JoinError::Panicked`, whose payload
the future makes). A future reports the failure of its task this way without unwinding, so
that the failure reaches the observers of the handle with `panic = "abort"` too (#567). A
panic of the future still fails the task as with [`spawn_local_on`](/docs/0.5.0/api/ferroui-system/task/function-spawn_local_on/), and an abort still
cancels it.

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

## Availability

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