pub struct Input {
pub input_type: String,
pub value: String,
pub placeholder: Option<String>,
pub disabled: bool,
pub required: bool,
pub label: Option<String>,
pub error: Option<String>,
pub helper_text: Option<String>,
pub on_change: Option<fn(String)>,
/* private fields */
}
Expand description
Input component
Fields§
§input_type: String
Input type (text, password, email, etc.)
value: String
Input value
placeholder: Option<String>
Input placeholder
disabled: bool
Whether the input is disabled
required: bool
Whether the input is required
label: Option<String>
Input label
error: Option<String>
Input error message
helper_text: Option<String>
Input helper text
on_change: Option<fn(String)>
On change handler
Trait Implementations§
Source§impl Component for Input
impl Component for Input
Source§type Props = InputProps
type Props = InputProps
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
Auto Trait Implementations§
impl Freeze for Input
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnwindSafe for Input
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