use crate::component::{ComponentPackage, ConstructFn, DependencyDecl, RestoreFn, SerializeFn};
pub struct ConcreteComponentRegistration {
pub type_name: &'static str,
pub package: ComponentPackage,
pub serialize_fn: SerializeFn,
pub restore_fn: RestoreFn,
pub construct_fn: ConstructFn,
pub dependencies: &'static [DependencyDecl],
}
inventory::collect!(ConcreteComponentRegistration);
pub fn find_concrete_component(type_name: &str) -> Option<&'static ConcreteComponentRegistration> {
inventory::iter::<ConcreteComponentRegistration>
.into_iter()
.find(|r| r.type_name == type_name)
}
pub fn concrete_components() -> impl Iterator<Item = &'static ConcreteComponentRegistration> {
inventory::iter::<ConcreteComponentRegistration>.into_iter()
}
pub use inventory;