mini_service_locator
provides a simple thread-safe service locator: a container that
stores "service" objects of different types, allowing for retrieval of a service by its type.
```rust use miniservicelocator::ServiceLocator;
struct MyUsefulService { somesharedthing: i32 }
let mut locator = ServiceLocator::default();
// Put a MyUsefulService into the locator. locator.provide(MyUsefulService { somesharedthing: 24 });
// Later, we can fetch this service.
// If we don't use store the resulting service as mut
, we won't be allowed to write to it.
// We can run get
asserteq!(usefulservice.read().somesharedthing, 24); usefulservice.write().somesharedthing = 32; asserteq!(usefulservice.read().someshared_thing, 32);