pub struct InputElement {
pub node_id: NodeId,
pub input_type: InputType,
pub name: String,
pub value: String,
pub checked: bool,
pub cursor_pos: usize,
pub focused: bool,
pub placeholder: String,
pub disabled: bool,
pub max_length: usize,
}Expand description
An element’s state
Fields§
§node_id: NodeIdNode ID in the DOM
input_type: InputTypeInput type
name: StringName attribute
value: StringCurrent value
checked: boolWhether the input is checked (checkbox/radio)
cursor_pos: usizeCursor position within value (for text inputs)
focused: boolWhether the input has focus
placeholder: StringPlaceholder text
disabled: boolWhether the input is disabled
max_length: usizeMaximum length (0 = unlimited)
Implementations§
Source§impl InputElement
impl InputElement
pub fn new(node_id: NodeId, input_type: InputType, name: &str) -> Self
Sourcepub fn toggle_checked(&mut self)
pub fn toggle_checked(&mut self)
Toggle checked state (for checkbox/radio)
Sourcepub fn display_text(&self) -> String
pub fn display_text(&self) -> String
Get display text (masked for password fields)
Trait Implementations§
Source§impl Clone for InputElement
impl Clone for InputElement
Source§fn clone(&self) -> InputElement
fn clone(&self) -> InputElement
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InputElement
impl Debug for InputElement
Source§impl Default for InputElement
impl Default for InputElement
Source§fn default() -> InputElement
fn default() -> InputElement
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InputElement
impl RefUnwindSafe for InputElement
impl Send for InputElement
impl Sync for InputElement
impl Unpin for InputElement
impl UnwindSafe for InputElement
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)