# IOptionalFeatureProvider

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/platform/trait-ioptionalfeatureprovider/

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

```rust
trait IOptionalFeatureProvider
```

Something that can expose optional, backend-specific features by type.

Features are looked up by the `TypeId` of the feature's type, which may be
a trait object type (`TypeId::of::<dyn IFoo>()`); the returned value then
holds an `Rc<dyn IFoo>`, or an `Arc<dyn IFoo>` for a feature that is
shared by threads.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/i_optional_feature_provider.rs#L11)

## Members

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

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

### try_get_feature

```rust
fn try_get_feature(self: &Self, feature_type: TypeId) -> Option<Rc<dyn Any>>
```

Queries for an optional feature.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/platform/i_optional_feature_provider.rs#L13)

## Availability

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