# SerialDisposableValue

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactive/disposables/struct-serialdisposablevalue/

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

```rust
struct SerialDisposableValue
```

A slot whose disposable can be replaced, disposing the previous one (`SerialDisposableValue`).
A disposable assigned after the slot was disposed is disposed at once.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/disposables/serial_disposable.rs#L11)

## Members

- [`new`](#function-new)
- [`is_disposed`](#function-is_disposed)
- [`disposable`](#function-disposable)
- [`set_disposable`](#function-set_disposable)
- [`try_set_first`](#function-try_set_first)
- [`dispose`](#function-dispose)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/disposables/serial_disposable.rs#L22)

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

### is_disposed

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/disposables/serial_disposable.rs#L26)

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

### disposable

```rust
fn disposable(self: &Self) -> Option<Rc<dyn IDisposable>>
```

The current disposable, if any.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/disposables/serial_disposable.rs#L31)

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

### set_disposable

```rust
fn set_disposable(self: &Self, value: Option<Rc<dyn IDisposable>>)
```

Replaces the disposable and disposes the previous one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/disposables/serial_disposable.rs#L39)

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

### try_set_first

```rust
fn try_set_first(self: &Self, value: Rc<dyn IDisposable>) -> bool
```

Assigns the first disposable; false when one was assigned already (`TrySetFirst`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/disposables/serial_disposable.rs#L56)

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

### dispose

```rust
fn dispose(self: &Self)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/disposables/serial_disposable.rs#L72)

## Trait implementations

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

## Availability

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