pub trait AnyComponent:
Send
+ Sync
+ Any {
Show 20 methods
// Required methods
fn component_id(&self) -> ComponentId;
fn lifecycle_phase(&self) -> LifecyclePhase;
fn set_lifecycle_phase(&mut self, phase: LifecyclePhase);
fn request_update(&mut self) -> Result<(), ComponentError>;
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
fn type_name(&self) -> &'static str;
fn any_initialize(&mut self) -> Result<(), ComponentError>;
fn any_mount(&mut self) -> Result<(), ComponentError>;
fn any_before_update(
&mut self,
props: Box<dyn Props>,
) -> Result<(), ComponentError>;
fn any_update(
&mut self,
props: Box<dyn Props>,
) -> Result<(), ComponentError>;
fn any_after_update(&mut self) -> Result<(), ComponentError>;
fn any_before_unmount(&mut self) -> Result<(), ComponentError>;
fn any_unmount(&mut self) -> Result<(), ComponentError>;
fn any_on_mount(
&mut self,
context: &MountContext,
) -> Result<(), ComponentError>;
fn any_before_mount(&mut self) -> Result<(), ComponentError>;
fn any_after_mount(&mut self) -> Result<(), ComponentError>;
fn any_on_update(
&mut self,
changes: &StateChanges,
) -> Result<(), ComponentError>;
fn any_on_unmount(
&mut self,
context: &UnmountContext,
) -> Result<(), ComponentError>;
fn any_after_unmount(&mut self) -> Result<(), ComponentError>;
}
Expand description
Type-erased component trait for dynamic dispatch
Required Methods§
Sourcefn component_id(&self) -> ComponentId
fn component_id(&self) -> ComponentId
Get unique component ID for debugging and tracking
Sourcefn lifecycle_phase(&self) -> LifecyclePhase
fn lifecycle_phase(&self) -> LifecyclePhase
Get current lifecycle phase
Sourcefn set_lifecycle_phase(&mut self, phase: LifecyclePhase)
fn set_lifecycle_phase(&mut self, phase: LifecyclePhase)
Set lifecycle phase (framework internal)
Sourcefn request_update(&mut self) -> Result<(), ComponentError>
fn request_update(&mut self) -> Result<(), ComponentError>
Request that this component be re-rendered
Sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Convert to mutable Any for downcasting
Sourcefn any_initialize(&mut self) -> Result<(), ComponentError>
fn any_initialize(&mut self) -> Result<(), ComponentError>
Initialize the component (post-creation)
Sourcefn any_mount(&mut self) -> Result<(), ComponentError>
fn any_mount(&mut self) -> Result<(), ComponentError>
Mount component - called when component is first added to the tree
Sourcefn any_before_update(
&mut self,
props: Box<dyn Props>,
) -> Result<(), ComponentError>
fn any_before_update( &mut self, props: Box<dyn Props>, ) -> Result<(), ComponentError>
Called before component updates with new props
Sourcefn any_update(&mut self, props: Box<dyn Props>) -> Result<(), ComponentError>
fn any_update(&mut self, props: Box<dyn Props>) -> Result<(), ComponentError>
Update component with new props (type-erased)
Sourcefn any_after_update(&mut self) -> Result<(), ComponentError>
fn any_after_update(&mut self) -> Result<(), ComponentError>
Called after the component has updated
Sourcefn any_before_unmount(&mut self) -> Result<(), ComponentError>
fn any_before_unmount(&mut self) -> Result<(), ComponentError>
Called before component is unmounted
Sourcefn any_unmount(&mut self) -> Result<(), ComponentError>
fn any_unmount(&mut self) -> Result<(), ComponentError>
Unmount component - called when component is removed from the tree
Sourcefn any_on_mount(&mut self, context: &MountContext) -> Result<(), ComponentError>
fn any_on_mount(&mut self, context: &MountContext) -> Result<(), ComponentError>
Enhanced mount with context
Sourcefn any_before_mount(&mut self) -> Result<(), ComponentError>
fn any_before_mount(&mut self) -> Result<(), ComponentError>
Before mount hook
Sourcefn any_after_mount(&mut self) -> Result<(), ComponentError>
fn any_after_mount(&mut self) -> Result<(), ComponentError>
After mount hook
Sourcefn any_on_update(
&mut self,
changes: &StateChanges,
) -> Result<(), ComponentError>
fn any_on_update( &mut self, changes: &StateChanges, ) -> Result<(), ComponentError>
Enhanced update with state changes
Sourcefn any_on_unmount(
&mut self,
context: &UnmountContext,
) -> Result<(), ComponentError>
fn any_on_unmount( &mut self, context: &UnmountContext, ) -> Result<(), ComponentError>
Enhanced unmount with context
Sourcefn any_after_unmount(&mut self) -> Result<(), ComponentError>
fn any_after_unmount(&mut self) -> Result<(), ComponentError>
After unmount hook
Implementors§
impl<T: Component> AnyComponent for T
Automatic implementation of AnyComponent for all Components