Struct he_di::container::RegisteredType
[−]
[src]
pub struct RegisteredType { /* fields omitted */ }
DI Container entry associated with a unique Component (i.e. struct).
When running the following command
container_builder.register::<MyImplOfTrait>().as_type::<Trait>();
- MyImplOfTrait
-> component
- Trait
-> as_trait
Methods
impl RegisteredType
[src]
fn as_type<T: ?Sized + 'static>(&mut self) -> &mut RegisteredType
Register the current Component as implementing T
type,
T
generally being a trait,
This method is compulsory, if not called, ContainerBuilder::build() will Err.
fn with_named_parameter<S: Into<String> + Clone, V: Any>(
&mut self,
name: S,
value: V
) -> &mut RegisteredType
&mut self,
name: S,
value: V
) -> &mut RegisteredType
Add a new parameter for this Container entry.
name
must match one of the struct's property name of the current Component.
fn with_typed_parameter<V: Any>(&mut self, value: V) -> &mut RegisteredType
Add a new parameter for this Container entry.
type
must refer to a unique property's.