# AnyObject

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactive/linq/trait-anyobject/

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

```rust
trait AnyObject: Sized + 'static
```

A value that can be cast to a value of a type (`object` of upstream's `Cast` and `OfType`):
implemented for `Rc<dyn Any>`.

A value casts to the type it was created with; Rust has no class inheritance, so a value does
not cast to the type of a base class as upstream's do.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/cast.rs#L18)

## Members

- [`downcast_object`](#function-downcast_object)

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

### downcast_object

```rust
fn downcast_object<U: 'static>(self: Self) -> Result<Rc<U>, Self>
```

The value as a value of `U`, or the value itself when it is not one (`(U)value`,
`value is U`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Reactive/linq/cast.rs#L21)

## Trait implementations

- [`AnyObject`](/docs/0.5.0/api/ferroui-reactive/linq/trait-anyobject/)

## Availability

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