Struct rscontainer::Resolver [−][src]
pub struct Resolver<'ctn> { /* fields omitted */ }
Expand description
Used to resolve services from the service container.
Acts as a safety measure. When the service container is supplied as a mutable reference, it is possible to replace the entire container with another one, shadowing all the services inside it. Malicious services could abuse this to manipulate the behaviour of the entire program. Through a resolver, only services can be resolved. It is not possible to override existing shared instances.
It is preferred that the resolver is passed by value. If this is not possible, passing by reference is still secure. It is not possible to shadow the resolver as it cannot be initialized from outside the rscontainer crate.
Implementations
Resolves a Shared
.
Resolves an owned instance.
Resolves an Instance::Shared
.
pub fn owned_instance<S: ?Sized + IShared + IOwned + 'static>(
&mut self,
params: S::Parameters
) -> Result<Instance<S>, <S as IOwned>::Error>
[src]
pub fn owned_instance<S: ?Sized + IShared + IOwned + 'static>(
&mut self,
params: S::Parameters
) -> Result<Instance<S>, <S as IOwned>::Error>
[src]Resolves an Instance::Owned
.
Trait Implementations
Auto Trait Implementations
impl<'ctn> RefUnwindSafe for Resolver<'ctn>
impl<'ctn> !UnwindSafe for Resolver<'ctn>