# ResourceProviderImpl

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/controls/trait-resourceproviderimpl/

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

```rust
trait ResourceProviderImpl: FerroObjectImpl + $crate::Upcast<ResourceProvider>
```

The overridable members introduced by the class.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/resource_provider.rs#L20)

## Members

- [`has_resources`](#function-has_resources)
- [`try_get_resource`](#function-try_get_resource)
- [`on_add_owner`](#function-on_add_owner)
- [`on_remove_owner`](#function-on_remove_owner)

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

### has_resources

```rust
fn has_resources(this: &Self) -> bool
```

Whether the provider has resources.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/resource_provider.rs#L20)

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

### try_get_resource

```rust
fn try_get_resource(this: &Self, key: &ResourceKey, theme: Option<&ThemeVariant>) -> Option<ResourceValue>
```

Tries to find a resource within the provider.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/resource_provider.rs#L20)

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

### on_add_owner

```rust
fn on_add_owner(this: &Self, owner: &ResourceHostRef)
```

Handles when the owner is added. The base method notifies the
owner about its resources changing, if the provider has any.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/resource_provider.rs#L20)

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

### on_remove_owner

```rust
fn on_remove_owner(this: &Self, owner: &ResourceHostRef)
```

Handles when the owner is removed. The base method notifies the
owner about its resources changing, if the provider has any.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/controls/resource_provider.rs#L20)

## Trait implementations

- [`ResourceProviderImpl`](/docs/0.5.0/api/ferroui-base/controls/trait-resourceproviderimpl/)

## Availability

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