pub struct TextInputElement {
pub id: String,
pub label: String,
pub placeholder: Option<String>,
pub initial_value: Option<String>,
pub multiline: bool,
pub optional: bool,
}Expand description
A single-line or multi-line text input element.
Fields§
§id: StringUnique identifier for the input (used in submission payloads).
label: StringLabel displayed above the input.
placeholder: Option<String>Placeholder text shown when the input is empty.
initial_value: Option<String>Pre-filled value.
multiline: boolWhen true, renders as a multi-line text area.
optional: boolWhen true, the field may be left blank on submission.
Implementations§
Source§impl TextInputElement
impl TextInputElement
Sourcepub fn new(id: impl Into<String>, label: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, label: impl Into<String>) -> Self
Create a new text input with the given identifier and label.
Sourcepub fn placeholder(self, placeholder: impl Into<String>) -> Self
pub fn placeholder(self, placeholder: impl Into<String>) -> Self
Set placeholder text.
Sourcepub fn initial_value(self, value: impl Into<String>) -> Self
pub fn initial_value(self, value: impl Into<String>) -> Self
Set the initial (pre-filled) value.
Trait Implementations§
Source§impl Clone for TextInputElement
impl Clone for TextInputElement
Source§fn clone(&self) -> TextInputElement
fn clone(&self) -> TextInputElement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextInputElement
impl Debug for TextInputElement
Source§impl<'de> Deserialize<'de> for TextInputElement
impl<'de> Deserialize<'de> for TextInputElement
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TextInputElement
impl RefUnwindSafe for TextInputElement
impl Send for TextInputElement
impl Sync for TextInputElement
impl Unpin for TextInputElement
impl UnsafeUnpin for TextInputElement
impl UnwindSafe for TextInputElement
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