# Owner

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-view/reactive/struct-owner/

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

```rust
struct Owner
```

What owns signals, memos and effects: they are disposed with it. A
mounted element tree has one; each item of a dynamic list has its own.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/reactive.rs#L607)

## Members

- [`new`](#function-new)
- [`new_root`](#function-new_root)
- [`current`](#function-current)
- [`with`](#function-with)
- [`dispose`](#function-dispose)
- [`is_alive`](#function-is_alive)
- [`provide_context`](#function-provide_context)
- [`context`](#function-context)

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

### new

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

A new owner, owned by the current one (if any): disposed with it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/reactive.rs#L613)

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

### new_root

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

A new owner that no other owner disposes: the root of a tree.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/reactive.rs#L618)

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

### current

```rust
fn current() -> Option<Self>
```

The owner of what is made now, if any.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/reactive.rs#L626)

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

### with

```rust
fn with<R>(self: &Self, f: impl FnOnce() -> R) -> R
```

Runs `f` with this owner current (and no observer: `f` itself is not
reactive).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/reactive.rs#L632)

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

### dispose

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

Disposes the owner and everything it owns; cleanups run.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/reactive.rs#L643)

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

### is_alive

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

Whether the owner was not disposed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/reactive.rs#L648)

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

### provide_context

```rust
fn provide_context<T: Clone + 'static>(self: &Self, value: T)
```

Provides `value` to what this owner owns, at any depth: `use_context`
finds it from an owner below. A value of the same type provided again
replaces it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/reactive.rs#L657)

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

### context

```rust
fn context<T: Clone + 'static>(self: &Self) -> Option<T>
```

The value of type `T` provided to this owner or to the nearest owner
above it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/reactive.rs#L670)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`IntoValue<T>`](/docs/0.5.0/api/ferroui-view/builder/trait-intovalue/)
- [`IntoValue<Option<T>>`](/docs/0.5.0/api/ferroui-view/builder/trait-intovalue/)
- [`FromValue<T>`](/docs/0.5.0/api/ferroui-view/builder/trait-fromvalue/)
- [`FromValue<Option<T>>`](/docs/0.5.0/api/ferroui-view/builder/trait-fromvalue/)
- [`IntoProp<T, Value>`](/docs/0.5.0/api/ferroui-view/builder/trait-intoprop/)
- [`AnyValueEq`](/docs/0.5.0/api/ferroui-view/element/trait-anyvalueeq/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`TreeModel`](/docs/0.5.0/api/ferroui-treedatagrid-core/accessor/trait-treemodel/)
- `Clone`
- `Copy`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Debug`
- `Default`

## Availability

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