# service_location

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

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

```rust
module service_location
```

Service location (`Splat.Core/ServiceLocation` and `Splat/ServiceLocation`): the interfaces of
a dependency resolver, the three resolvers of Splat, the locator that holds the current one
([`AppLocator`](/docs/0.5.0/api/ferroui-splat/service_location/struct-applocator/), [`Locator`](/docs/0.5.0/api/ferroui-splat/service_location/struct-locator/)) and the mixins over them.

A service is keyed by the type of the service, `S: ?Sized + 'static`, which may be a trait
object, and an optional contract; a registration is a factory that returns `Option<Rc<S>>`. The
interfaces are object safe, so that a resolver is held as `Rc<dyn IDependencyResolver>`: their
methods take the type as a [`ServiceType`](/docs/0.5.0/api/ferroui-splat/service_location/struct-servicetype/) and the service type-erased ([`ErasedService`](/docs/0.5.0/api/ferroui-splat/service_location/type_alias-erasedservice/)). The
generic API callers use (`register::<S>`, `get_service::<S>`, ...) is in the extension traits
[`ReadonlyDependencyResolverExt`](/docs/0.5.0/api/ferroui-splat/service_location/trait-readonlydependencyresolverext/) and [`MutableDependencyResolverExt`](/docs/0.5.0/api/ferroui-splat/service_location/trait-mutabledependencyresolverext/), implemented for every
resolver.

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

## Contents

- [`AppLocator`](/docs/0.5.0/api/ferroui-splat/service_location/struct-applocator/) — struct
- [`IDependencyResolver`](/docs/0.5.0/api/ferroui-splat/service_location/trait-idependencyresolver/) — trait
- [`IMutableDependencyResolver`](/docs/0.5.0/api/ferroui-splat/service_location/trait-imutabledependencyresolver/) — trait
- [`IReadonlyDependencyResolver`](/docs/0.5.0/api/ferroui-splat/service_location/trait-ireadonlydependencyresolver/) — trait
- [`MutableDependencyResolverExt`](/docs/0.5.0/api/ferroui-splat/service_location/trait-mutabledependencyresolverext/) — trait
- [`ReadonlyDependencyResolverExt`](/docs/0.5.0/api/ferroui-splat/service_location/trait-readonlydependencyresolverext/) — trait
- [`DependencyResolverMixins`](/docs/0.5.0/api/ferroui-splat/service_location/trait-dependencyresolvermixins/) — trait
- [`GlobalGenericFirstDependencyResolver`](/docs/0.5.0/api/ferroui-splat/service_location/struct-globalgenericfirstdependencyresolver/) — struct
- [`InstanceGenericFirstDependencyResolver`](/docs/0.5.0/api/ferroui-splat/service_location/struct-instancegenericfirstdependencyresolver/) — struct
- [`Locator`](/docs/0.5.0/api/ferroui-splat/service_location/struct-locator/) — struct
- [`ModernDependencyResolver`](/docs/0.5.0/api/ferroui-splat/service_location/struct-moderndependencyresolver/) — struct
- [`ResolverMixins`](/docs/0.5.0/api/ferroui-splat/service_location/trait-resolvermixins/) — trait
- [`initialize_splat`](/docs/0.5.0/api/ferroui-splat/service_location/function-initialize_splat/) — function
- [`ServiceLocationInitializationExt`](/docs/0.5.0/api/ferroui-splat/service_location/trait-servicelocationinitializationext/) — trait
- [`erase_service`](/docs/0.5.0/api/ferroui-splat/service_location/function-erase_service/) — function
- [`unerase_service`](/docs/0.5.0/api/ferroui-splat/service_location/function-unerase_service/) — function
- [`ErasedService`](/docs/0.5.0/api/ferroui-splat/service_location/type_alias-erasedservice/) — type alias
- [`LazyDisposal`](/docs/0.5.0/api/ferroui-splat/service_location/type_alias-lazydisposal/) — type alias
- [`RegistrationCallback`](/docs/0.5.0/api/ferroui-splat/service_location/type_alias-registrationcallback/) — type alias
- [`ServiceFactory`](/docs/0.5.0/api/ferroui-splat/service_location/type_alias-servicefactory/) — type alias
- [`ServiceType`](/docs/0.5.0/api/ferroui-splat/service_location/struct-servicetype/) — struct

## Availability

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