pub struct FlexibleCompoundComponent { /* private fields */ }
Expand description
A flexible compound component implementation
Implementations§
Source§impl FlexibleCompoundComponent
impl FlexibleCompoundComponent
pub fn new(context: Context) -> Self
pub fn add_sub_component( &mut self, component: Box<dyn Component<Props = FlexibleCompoundProps>>, )
Trait Implementations§
Source§impl Component for FlexibleCompoundComponent
impl Component for FlexibleCompoundComponent
Source§type Props = FlexibleCompoundProps
type Props = FlexibleCompoundProps
The props type for this component
Source§fn component_id(&self) -> ComponentId
fn component_id(&self) -> ComponentId
Get unique component ID for debugging and tracking
Source§fn create(_props: Self::Props, context: Context) -> Self
fn create(_props: Self::Props, context: Context) -> Self
Create a new component instance with enhanced tracking
Source§fn update(&mut self, props: Self::Props) -> Result<(), ComponentError>
fn update(&mut self, props: Self::Props) -> Result<(), ComponentError>
Update component with new props
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Convert to mutable Any for downcasting
Source§fn initialize(&mut self) -> Result<(), ComponentError>
fn initialize(&mut self) -> Result<(), ComponentError>
Initialize the component - called immediately after creation
Use this for setting up initial state and registering lifecycle hooks
Source§fn mount(&mut self) -> Result<(), ComponentError>
fn mount(&mut self) -> Result<(), ComponentError>
Mount component - called when component is first added to the tree
Automatic state change detection and update scheduling is enabled after this point
Source§fn on_mount(&mut self, _context: &MountContext) -> Result<(), ComponentError>
fn on_mount(&mut self, _context: &MountContext) -> Result<(), ComponentError>
Enhanced lifecycle hook - called when component is mounted with context
Source§fn before_mount(&mut self) -> Result<(), ComponentError>
fn before_mount(&mut self) -> Result<(), ComponentError>
Enhanced lifecycle hook - called before mount for initialization
Source§fn after_mount(&mut self) -> Result<(), ComponentError>
fn after_mount(&mut self) -> Result<(), ComponentError>
Enhanced lifecycle hook - called after mount for post-initialization
Source§fn state_changed(&mut self, _state_key: &str) -> Result<(), ComponentError>
fn state_changed(&mut self, _state_key: &str) -> Result<(), ComponentError>
Called when component state changes and updates are needed
Source§fn on_update(&mut self, _changes: &StateChanges) -> Result<(), ComponentError>
fn on_update(&mut self, _changes: &StateChanges) -> Result<(), ComponentError>
Enhanced lifecycle hook - called when state changes are detected
Source§fn request_update(&mut self) -> Result<(), ComponentError>
fn request_update(&mut self) -> Result<(), ComponentError>
Request that this component be re-rendered
Source§fn should_update(&self, _new_props: &Self::Props) -> bool
fn should_update(&self, _new_props: &Self::Props) -> bool
Check if component should update given new props
Override for performance optimization
Source§fn before_update(
&mut self,
_new_props: &Self::Props,
) -> Result<(), ComponentError>
fn before_update( &mut self, _new_props: &Self::Props, ) -> Result<(), ComponentError>
Called before component updates with new props
Source§fn after_update(&mut self) -> Result<(), ComponentError>
fn after_update(&mut self) -> Result<(), ComponentError>
Called after the component has updated
Source§fn before_unmount(&mut self) -> Result<(), ComponentError>
fn before_unmount(&mut self) -> Result<(), ComponentError>
Called before component is unmounted
Automatic cleanup of state subscriptions happens after this
Source§fn on_unmount(
&mut self,
_context: &UnmountContext,
) -> Result<(), ComponentError>
fn on_unmount( &mut self, _context: &UnmountContext, ) -> Result<(), ComponentError>
Enhanced lifecycle hook - called when component is unmounted with context
Source§fn after_unmount(&mut self) -> Result<(), ComponentError>
fn after_unmount(&mut self) -> Result<(), ComponentError>
Enhanced lifecycle hook - called after unmount for final cleanup
Source§fn unmount(&mut self) -> Result<(), ComponentError>
fn unmount(&mut self) -> Result<(), ComponentError>
Unmount component - called when component is removed from the tree
Source§fn cleanup(&mut self) -> Result<(), ComponentError>
fn cleanup(&mut self) -> Result<(), ComponentError>
Perform automatic cleanup (called by framework)
Source§fn lifecycle_phase(&self) -> LifecyclePhase
fn lifecycle_phase(&self) -> LifecyclePhase
Get current lifecycle phase
Source§impl CompoundComponent for FlexibleCompoundComponent
impl CompoundComponent for FlexibleCompoundComponent
type SubComponents = Vec<Box<dyn Component<Props = FlexibleCompoundProps>>>
Source§fn sub_components(&self) -> &Self::SubComponents
fn sub_components(&self) -> &Self::SubComponents
Get the sub-components of this compound component
Source§fn sub_components_mut(&mut self) -> &mut Self::SubComponents
fn sub_components_mut(&mut self) -> &mut Self::SubComponents
Get a mutable reference to sub-components
Source§fn render_compound(&self) -> Result<Vec<Node>, ComponentError>
fn render_compound(&self) -> Result<Vec<Node>, ComponentError>
Render all sub-components in order
Auto Trait Implementations§
impl Freeze for FlexibleCompoundComponent
impl !RefUnwindSafe for FlexibleCompoundComponent
impl Send for FlexibleCompoundComponent
impl Sync for FlexibleCompoundComponent
impl Unpin for FlexibleCompoundComponent
impl !UnwindSafe for FlexibleCompoundComponent
Blanket Implementations§
Source§impl<T> AnyComponent for Twhere
T: Component,
impl<T> AnyComponent for Twhere
T: Component,
Source§fn component_id(&self) -> ComponentId
fn component_id(&self) -> ComponentId
Get unique component ID for debugging and tracking
Source§fn lifecycle_phase(&self) -> LifecyclePhase
fn lifecycle_phase(&self) -> LifecyclePhase
Get current lifecycle phase
Source§fn set_lifecycle_phase(&mut self, _phase: LifecyclePhase)
fn set_lifecycle_phase(&mut self, _phase: LifecyclePhase)
Set lifecycle phase (framework internal)
Source§fn request_update(&mut self) -> Result<(), ComponentError>
fn request_update(&mut self) -> Result<(), ComponentError>
Request that this component be re-rendered
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert to mutable Any for downcasting
Source§fn any_initialize(&mut self) -> Result<(), ComponentError>
fn any_initialize(&mut self) -> Result<(), ComponentError>
Initialize the component (post-creation)
Source§fn any_mount(&mut self) -> Result<(), ComponentError>
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>
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>
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>
fn any_after_update(&mut self) -> Result<(), ComponentError>
Called after the component has updated
Source§fn any_before_unmount(&mut self) -> Result<(), ComponentError>
fn any_before_unmount(&mut self) -> Result<(), ComponentError>
Called before component is unmounted
Source§fn any_unmount(&mut self) -> Result<(), ComponentError>
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>
fn any_on_mount(&mut self, context: &MountContext) -> Result<(), ComponentError>
Enhanced mount with context
Source§fn any_before_mount(&mut self) -> Result<(), ComponentError>
fn any_before_mount(&mut self) -> Result<(), ComponentError>
Before mount hook
Source§fn any_after_mount(&mut self) -> Result<(), ComponentError>
fn any_after_mount(&mut self) -> Result<(), ComponentError>
After mount hook
Source§fn any_on_update(
&mut self,
changes: &StateChanges,
) -> Result<(), ComponentError>
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>
fn any_on_unmount( &mut self, context: &UnmountContext, ) -> Result<(), ComponentError>
Enhanced unmount with context
Source§fn any_after_unmount(&mut self) -> Result<(), ComponentError>
fn any_after_unmount(&mut self) -> Result<(), ComponentError>
After unmount hook
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