pub struct ComponentDefinition {
pub names: FxHashSet<String>,
pub is_primary: bool,
pub scope: String,
pub resolved_type_id: TypeId,
pub constructor: Constructor,
pub cast: CastFunction,
}Expand description
Definition for a Component registered in a definition registry.
Fields§
§names: FxHashSet<String>Each component has at least one name, which can be used to request a specific instance. Derive-based components have their name generated from type name by converting it to snake case.
is_primary: boolWith multiple components registered for a given type, one of them can be marked as primary and returned when requesting a single instance.
scope: String§resolved_type_id: TypeIdConcrete component type id. Since aliases can share definitions with their targets, there can be a need to find out what is the leaf type.
constructor: ConstructorConstructor method for type-erased instances.
cast: CastFunctionCast function associated for given type. Please see the documentation for CastFunction for details on usage.
Trait Implementations§
source§impl Clone for ComponentDefinition
impl Clone for ComponentDefinition
source§fn clone(&self) -> ComponentDefinition
fn clone(&self) -> ComponentDefinition
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more