# use_resource_as

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-view/hooks/function-use_resource_as/

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

```rust
fn use_resource_as<T: Clone + 'static>(key: &str) -> Option<T>
```

The resource `key` as a `T` (see [`use_resource`](/docs/0.5.0/api/ferroui-view/hooks/function-use_resource/)): the conversion of
markup values, so a brush of a theme is a `Rc<dyn IBrush>` and a colour a
`Color`. `None` when the resource is missing or not a `T`.

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

## Availability

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