pub struct StaticComponentDefinitionRegistry { /* private fields */ }
Expand description

Registry of component definitions initialized from statically registered definitions.

Implementations§

source§

impl StaticComponentDefinitionRegistry

source

pub fn new<CF: ContextFactory>( allow_definition_overriding: bool, context_factory: &CF ) -> Result<Self, ComponentDefinitionRegistryError>

Trait Implementations§

source§

impl Clone for StaticComponentDefinitionRegistry

source§

fn clone(&self) -> StaticComponentDefinitionRegistry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ComponentDefinitionRegistry for StaticComponentDefinitionRegistry

source§

fn register_component( &mut self, target: TypeId, target_name: &str, metadata: &ComponentMetadata ) -> Result<(), ComponentDefinitionRegistryError>

Adds a new definition for a given type. Note: handling of duplicate component names is registry-dependent. Name is used for reporting purposes.
source§

fn register_alias( &mut self, alias_type: TypeId, target_type: TypeId, alias_name: &str, target_name: &str, metadata: &ComponentAliasMetadata ) -> Result<(), ComponentDefinitionRegistryError>

Adds an alias for a component of target type. This is useful when registering dyn Trait as an alias for a given concrete type. If alias cannot by cast to target, component creation will fail. Names are used for reporting purposes.
source§

fn components_by_type(&self, type_id: TypeId) -> Vec<ComponentDefinition>

Returns all registered definitions for a given type.
source§

fn component_by_name( &self, name: &str, type_id: TypeId ) -> Option<ComponentDefinition>

Returns a definition with given name.
source§

fn primary_component(&self, type_id: TypeId) -> Option<ComponentDefinition>

Returns primary component for a given type.
source§

fn is_registered(&self, type_id: TypeId) -> bool

Checks if given type is present in this registry.
source§

fn is_name_registered(&self, name: &str) -> bool

Checks if there’s a definition with given name.
source§

fn all_definitions(&self) -> FxHashMap<TypeId, Vec<ComponentDefinition>>

Returns a copy of the whole registry as a map.
source§

impl ComponentDefinitionRegistryFacade for StaticComponentDefinitionRegistry

source§

fn is_registered(&self, target: TypeId) -> bool

Checks if given type is present in this registry.
source§

fn is_name_registered(&self, name: &str) -> bool

Checks if there’s a definition with given name.
source§

impl Debug for StaticComponentDefinitionRegistry

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<CDR> TypedComponentDefinitionRegistry for CDRwhere CDR: ComponentDefinitionRegistry + ?Sized,