# SynchronousCompletionAsyncResult

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/utilities/struct-synchronouscompletionasyncresult/

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

```rust
struct SynchronousCompletionAsyncResult<T: Clone>
```

The result of an operation that either has completed already or completes
later, in which case its continuations run synchronously at completion.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/synchronous_completion_async_result.rs#L7)

## Members

- [`new`](#function-new)
- [`is_completed`](#function-is_completed)
- [`get_result`](#function-get_result)
- [`on_completed`](#function-on_completed)

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

### new

```rust
fn new(result: T) -> Self
```

Creates a completed result.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/synchronous_completion_async_result.rs#L19)

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

### is_completed

```rust
fn is_completed(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/synchronous_completion_async_result.rs#L23)

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

### get_result

```rust
fn get_result(self: &Self) -> T
```

The result. Panics if the operation is not yet completed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/synchronous_completion_async_result.rs#L31)

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

### on_completed

```rust
fn on_completed(self: &Self, continuation: impl FnOnce() -> () + 'static)
```

Runs `continuation` now if the operation has completed without a
source, otherwise when the source completes.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/synchronous_completion_async_result.rs#L40)

## Trait implementations

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

## Availability

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