# IServiceProvider

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-dependency-injection/trait-iserviceprovider/

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

```rust
trait IServiceProvider
```



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

## Members

- [`ensure_active`](#function-ensure_active)
- [`required_service_provider`](#function-required_service_provider)
- [`disposable`](#function-disposable)
- [`required_service_erased`](#function-required_service_erased)
- [`get_service_erased`](#function-get_service_erased)
- [`get_services_erased`](#function-get_services_erased)

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

### ensure_active

```rust
fn ensure_active(self: &Self) -> ServiceResult<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DependencyInjection/service_provider.rs#L21)

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

### required_service_provider

```rust
fn required_service_provider(self: &Self) -> Option<&dyn ISupportRequiredService>
```

Explicit capability query replaces CLR interface casts for alternate providers.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DependencyInjection/service_provider.rs#L25)

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

### disposable

```rust
fn disposable(self: &Self) -> Option<&dyn IDisposable>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DependencyInjection/service_provider.rs#L28)

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

### required_service_erased

```rust
fn required_service_erased(self: &Self, id: &ServiceIdentifier) -> ServiceResult<ErasedService>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DependencyInjection/service_provider.rs#L31)

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

### get_service_erased

```rust
fn get_service_erased(self: &Self, id: &ServiceIdentifier) -> ServiceResult<Option<ErasedService>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DependencyInjection/service_provider.rs#L39)

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

### get_services_erased

```rust
fn get_services_erased(self: &Self, id: &ServiceIdentifier) -> ServiceResult<Vec<ErasedService>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DependencyInjection/service_provider.rs#L40)

## Trait implementations

- [`IServiceProvider`](/docs/0.5.0/api/ferroui-base/metadata/trait-iserviceprovider/)

## Availability

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