# SharedSender

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-system/task/struct-sharedsender/

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

```rust
struct SharedSender<T>
```

The end of a [`Shared`](/docs/0.5.0/api/ferroui-system/task/struct-shared/) that code ends by hand (`Shared::channel`): once, on the thread of
the `Shared` (the role of `TaskCompletionSource<T>`: `SetResult` is `send`,
`SetCanceled` is `cancel`, and `SetException` is `send(Err(error))` on a
`Shared` of a `Result`).

Dropping it without sending leaves the `Shared` pending, as a `TaskCompletionSource` that is
dropped leaves its task, and as the reactive libraries need (`ToTask` of a sequence that lets
go of its observer without ending, `Never`, gives a task that never ends). This differs from
`oneshot`, whose dropped sender cancels the receiver.

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

## Members

- [`send`](#function-send)
- [`cancel`](#function-cancel)
- [`shared`](#function-shared)

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

### send

```rust
fn send(self: Self, value: T)
```

Ends the `Shared` with `value`, running its continuations and then waking its awaiting
futures inside this call.

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

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

### cancel

```rust
fn cancel(self: Self)
```

Ends the `Shared` with `JoinError::Canceled`, running its continuations and then waking
its awaiting futures inside this call.

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

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

### shared

```rust
fn shared(self: &Self) -> Shared<T>
```

The `Shared` that this ends.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `Debug`

## Availability

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