# FerroObjectHandles

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui-controls/struct-ferroobjecthandles/

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

```rust
struct FerroObjectHandles
```

The registry of the types that stand for a FerroUI object in the untyped values of ReactiveUI,
and the lookup of the object behind such a value.

Deviation (DEVIATIONS.md, ReactiveUI controls): upstream tests an untyped object with
`is FerroObject`; Rust cannot ask a `dyn Any` whether it is a class of the object model, so
the handles of the classes are recognised through the type model of the framework and other
types are registered.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/ferro_object_handles.rs#L37)

## Members

- [`register`](#function-register)
- [`register_class`](#function-register_class)
- [`object_of`](#function-object_of)
- [`handle_of`](#function-handle_of)

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

### register

```rust
fn register<H: 'static>(object_of: fn(&H) -> Ref<FerroObject>)
```

Registers `H` as a type that stands for a FerroUI object: `object_of` gives the object
behind a value of it. A view that wraps its control (`struct MyView(Ref<UserControl>)`)
registers itself so that the activation fetcher and the property observer see the control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/ferro_object_handles.rs#L43)

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

### register_class

```rust
fn register_class<T: ObjectType>()
```

Registers the class `T` itself (its struct, as an `Rc<T>` that is the allocation of the
object) as a type that stands for its object: a class that implements a trait of ReactiveUI
on its struct (`IActivatableView`) is seen through it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/ferro_object_handles.rs#L53)

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

### object_of

```rust
fn object_of(value: &dyn Any) -> Option<Ref<FerroObject>>
```

The FerroUI object `value` stands for, or `None` when it is not one (`value as FerroObject`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/ferro_object_handles.rs#L64)

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

### handle_of

```rust
fn handle_of<T: ObjectType>(object: &Ref<T>) -> Rc<dyn Any>
```

The untyped form of `object` that the integration gives ReactiveUI: its handle as a
`Ref<FerroObject>` in an `Rc<dyn Any>`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/ferro_object_handles.rs#L81)

## Trait implementations

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

## Availability

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