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.

Resolves an Instance::Owned.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.