Trait AnyComponent

Source
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§

Source

fn component_id(&self) -> ComponentId

Get unique component ID for debugging and tracking

Source

fn lifecycle_phase(&self) -> LifecyclePhase

Get current lifecycle phase

Source

fn set_lifecycle_phase(&mut self, phase: LifecyclePhase)

Set lifecycle phase (framework internal)

Source

fn request_update(&mut self) -> Result<(), ComponentError>

Request that this component be re-rendered

Source

fn as_any(&self) -> &dyn Any

Convert to Any for downcasting

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Convert to mutable Any for downcasting

Source

fn type_name(&self) -> &'static str

Get component type name for debugging

Source

fn any_initialize(&mut self) -> Result<(), ComponentError>

Initialize the component (post-creation)

Source

fn any_mount(&mut self) -> Result<(), ComponentError>

Mount component - called when component is first added to the tree

Source

fn any_before_update( &mut self, props: Box<dyn Props>, ) -> Result<(), ComponentError>

Called before component updates with new props

Source

fn any_update(&mut self, props: Box<dyn Props>) -> Result<(), ComponentError>

Update component with new props (type-erased)

Source

fn any_after_update(&mut self) -> Result<(), ComponentError>

Called after the component has updated

Source

fn any_before_unmount(&mut self) -> Result<(), ComponentError>

Called before component is unmounted

Source

fn any_unmount(&mut self) -> Result<(), ComponentError>

Unmount component - called when component is removed from the tree

Source

fn any_on_mount(&mut self, context: &MountContext) -> Result<(), ComponentError>

Enhanced mount with context

Source

fn any_before_mount(&mut self) -> Result<(), ComponentError>

Before mount hook

Source

fn any_after_mount(&mut self) -> Result<(), ComponentError>

After mount hook

Source

fn any_on_update( &mut self, changes: &StateChanges, ) -> Result<(), ComponentError>

Enhanced update with state changes

Source

fn any_on_unmount( &mut self, context: &UnmountContext, ) -> Result<(), ComponentError>

Enhanced unmount with context

Source

fn any_after_unmount(&mut self) -> Result<(), ComponentError>

After unmount hook

Implementors§

Source§

impl<T: Component> AnyComponent for T

Automatic implementation of AnyComponent for all Components