pub struct LifecycleManager { /* private fields */ }
Expand description
Manages the lifecycle of components
Implementations§
Source§impl LifecycleManager
impl LifecycleManager
Sourcepub fn new(component: ComponentInstance, context: Context) -> Self
pub fn new(component: ComponentInstance, context: Context) -> Self
Create a new lifecycle manager for a component
Sourcepub fn current_phase(&self) -> LifecyclePhase
pub fn current_phase(&self) -> LifecyclePhase
Get the current lifecycle phase
Sourcepub fn get_component(&self) -> &Arc<Mutex<ComponentInstance>>
pub fn get_component(&self) -> &Arc<Mutex<ComponentInstance>>
Get a reference to the component instance
Sourcepub fn initialize(&mut self) -> Result<(), ComponentError>
pub fn initialize(&mut self) -> Result<(), ComponentError>
Initialize the component (post-creation)
Sourcepub fn mount(&mut self) -> Result<(), ComponentError>
pub fn mount(&mut self) -> Result<(), ComponentError>
Mount the component to the tree
Sourcepub fn update(&mut self, props: Box<dyn Props>) -> Result<(), ComponentError>
pub fn update(&mut self, props: Box<dyn Props>) -> Result<(), ComponentError>
Update the component with new props
Sourcepub fn unmount(&mut self) -> Result<(), ComponentError>
pub fn unmount(&mut self) -> Result<(), ComponentError>
Unmount the component from the tree
Sourcepub fn handle_updates(&mut self) -> Result<(), ComponentError>
pub fn handle_updates(&mut self) -> Result<(), ComponentError>
Handle updates to the component
Sourcepub fn get_context(&self) -> &Context
pub fn get_context(&self) -> &Context
Get a reference to the component’s context
Auto Trait Implementations§
impl Freeze for LifecycleManager
impl RefUnwindSafe for LifecycleManager
impl Send for LifecycleManager
impl Sync for LifecycleManager
impl Unpin for LifecycleManager
impl UnwindSafe for LifecycleManager
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