pub struct ComponentRegistry { /* private fields */ }Expand description
Component registry for managing component types and factories
Implementations§
Source§impl ComponentRegistry
impl ComponentRegistry
Sourcepub fn register_factory(
&mut self,
component_type: &str,
factory: Arc<dyn ComponentFactory>,
) -> SklResult<()>
pub fn register_factory( &mut self, component_type: &str, factory: Arc<dyn ComponentFactory>, ) -> SklResult<()>
Register a component factory
Sourcepub fn create_component(
&self,
component_type: &str,
config: &ComponentConfig,
) -> SklResult<Box<dyn PluggableComponent>>
pub fn create_component( &self, component_type: &str, config: &ComponentConfig, ) -> SklResult<Box<dyn PluggableComponent>>
Create a component instance
Sourcepub fn get_registered_types(&self) -> Vec<String>
pub fn get_registered_types(&self) -> Vec<String>
Get registered component types
Sourcepub fn is_registered(&self, component_type: &str) -> bool
pub fn is_registered(&self, component_type: &str) -> bool
Check if component type is registered
Sourcepub fn get_type_metadata(
&self,
component_type: &str,
) -> Option<&ComponentTypeMetadata>
pub fn get_type_metadata( &self, component_type: &str, ) -> Option<&ComponentTypeMetadata>
Get component type metadata
Sourcepub fn unregister(&mut self, component_type: &str) -> SklResult<()>
pub fn unregister(&mut self, component_type: &str) -> SklResult<()>
Unregister a component type
Trait Implementations§
Source§impl Debug for ComponentRegistry
impl Debug for ComponentRegistry
Auto Trait Implementations§
impl Freeze for ComponentRegistry
impl !RefUnwindSafe for ComponentRegistry
impl Send for ComponentRegistry
impl Sync for ComponentRegistry
impl Unpin for ComponentRegistry
impl !UnwindSafe for ComponentRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more