# IMutableDependencyResolver

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-splat/service_location/trait-imutabledependencyresolver/

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

```rust
trait IMutableDependencyResolver
```

Registers services (`IMutableDependencyResolver`).

The methods are the object-safe core: callers use the generic forms of
[`MutableDependencyResolverExt`](/docs/0.5.0/api/ferroui-splat/service_location/trait-mutabledependencyresolverext/).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/service_location/dependency_resolver.rs#L40)

## Members

- [`has_registration_erased`](#function-has_registration_erased)
- [`register_erased`](#function-register_erased)
- [`register_constant_erased`](#function-register_constant_erased)
- [`register_lazy_singleton_erased`](#function-register_lazy_singleton_erased)
- [`unregister_current_erased`](#function-unregister_current_erased)
- [`unregister_all_erased`](#function-unregister_all_erased)
- [`service_registration_callback_erased`](#function-service_registration_callback_erased)

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

### has_registration_erased

```rust
fn has_registration_erased(self: &Self, service_type: ServiceType, contract: Option<&str>) -> bool
```

Whether a service is registered for `service_type` and `contract` (`HasRegistration<T>`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/service_location/dependency_resolver.rs#L42)

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

### register_erased

```rust
fn register_erased(self: &Self, factory: ServiceFactory, service_type: ServiceType, contract: Option<&str>)
```

Registers a factory, called for each resolution (`Register<T>(Func<T?>, string?)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/service_location/dependency_resolver.rs#L45)

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

### register_constant_erased

```rust
fn register_constant_erased(self: &Self, value: Option<ErasedService>, disposal: Option<Rc<dyn Fn() -> ()>>, service_type: ServiceType, contract: Option<&str>)
```

Registers a constant (`RegisterConstant<T>(T?, string?)`). `disposal` is what disposing the
resolver does with it: upstream disposes a constant that is `IDisposable`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/service_location/dependency_resolver.rs#L54)

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

### register_lazy_singleton_erased

```rust
fn register_lazy_singleton_erased(self: &Self, factory: ServiceFactory, disposal: Option<LazyDisposal>, service_type: ServiceType, contract: Option<&str>)
```

Registers a singleton created by `factory` on its first resolution
(`RegisterLazySingleton<T>(Func<T?>, string?)`). `disposal` is what disposing the resolver
does with the value once it was created.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/service_location/dependency_resolver.rs#L65)

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

### unregister_current_erased

```rust
fn unregister_current_erased(self: &Self, service_type: ServiceType, contract: Option<&str>)
```

Removes the last registration (`UnregisterCurrent<T>(string?)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/service_location/dependency_resolver.rs#L74)

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

### unregister_all_erased

```rust
fn unregister_all_erased(self: &Self, service_type: ServiceType, contract: Option<&str>)
```

Removes every registration (`UnregisterAll<T>(string?)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/service_location/dependency_resolver.rs#L77)

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

### service_registration_callback_erased

```rust
fn service_registration_callback_erased(self: &Self, service_type: ServiceType, contract: Option<&str>, callback: RegistrationCallback) -> Rc<dyn IDisposable>
```

Calls `callback` for every registration, those that exist and those to come, until the
returned disposable is disposed (`ServiceRegistrationCallback<T>(string?, Action<IDisposable>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/service_location/dependency_resolver.rs#L81)

## Trait implementations

- [`IMutableDependencyResolver`](/docs/0.5.0/api/ferroui-splat/service_location/trait-imutabledependencyresolver/)

## Availability

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