pub struct ConcreteComponentRegistration {
pub type_name: &'static str,
pub package: ComponentPackage,
pub serialize_fn: fn(&(dyn ErasedComponent + 'static)) -> Vec<u8>,
pub restore_fn: fn(&[u8]) -> Result<Box<dyn ErasedComponent>, RestoreError>,
pub construct_fn: fn(&(dyn Any + 'static)) -> Result<Box<dyn ErasedComponent>, ConstructError>,
pub dependencies: &'static [DependencyDecl],
}Expand description
Inventory entry for a concrete component, keyed by TYPE_NAME.
Fields§
§type_name: &'static strConcreteComponent::TYPE_NAME.
package: ComponentPackagePackage origin.
serialize_fn: fn(&(dyn ErasedComponent + 'static)) -> Vec<u8>Monomorphized T::serialize.
restore_fn: fn(&[u8]) -> Result<Box<dyn ErasedComponent>, RestoreError>Monomorphized T::restore.
construct_fn: fn(&(dyn Any + 'static)) -> Result<Box<dyn ErasedComponent>, ConstructError>Downcasts &dyn Any → &T::Config then calls T::new.
dependencies: &'static [DependencyDecl]Mirror of ConcreteComponent::DEPENDENCIES.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConcreteComponentRegistration
impl RefUnwindSafe for ConcreteComponentRegistration
impl Send for ConcreteComponentRegistration
impl Sync for ConcreteComponentRegistration
impl Unpin for ConcreteComponentRegistration
impl UnsafeUnpin for ConcreteComponentRegistration
impl UnwindSafe for ConcreteComponentRegistration
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