# StyleHostRef

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/styling/enum-stylehostref/

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

```rust
enum StyleHostRef
```

A strong reference to a style host: a styled element, or another host
such as the application object.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/i_style_host.rs#L37)

## Members

- [`Element`](#variant-element)
- [`Other`](#variant-other)
- [`as_element`](#function-as_element)
- [`to_resource_host`](#function-to_resource_host)

<a id="variant-element"></a>

### Element

```rust
Element(crate::Ref<crate::StyledElement>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/i_style_host.rs#L38)

<a id="variant-other"></a>

### Other

```rust
Other(std::rc::Rc<dyn IStyleHost>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/i_style_host.rs#L39)

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

### as_element

```rust
fn as_element(self: &Self) -> Option<&Ref<StyledElement>>
```

The host as a styled element, if it is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/i_style_host.rs#L45)

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

### to_resource_host

```rust
fn to_resource_host(self: &Self) -> ResourceHostRef
```

The host as a resource host.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/styling/i_style_host.rs#L53)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`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/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Deref`
- `PartialEq`
- `From<Ref<T>>`
- `From<&Ref<T>>`
- `From<Rc<dyn IStyleHost>>`
- `From<Rc<T>>`

## Availability

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