pub struct CreateInputText(/* private fields */);
Expand description
A builder for creating an input text component in a modal
Implementations§
Source§impl CreateInputText
impl CreateInputText
Sourcepub fn new(
style: InputTextStyle,
label: impl Into<String>,
custom_id: impl Into<String>,
) -> Self
pub fn new( style: InputTextStyle, label: impl Into<String>, custom_id: impl Into<String>, ) -> Self
Creates a text input with the given style, label, and custom id (a developer-defined identifier), leaving all other fields empty.
Sourcepub fn style(self, kind: InputTextStyle) -> Self
pub fn style(self, kind: InputTextStyle) -> Self
Sets the style of this input text. Replaces the current value as set in Self::new
.
Sourcepub fn label(self, label: impl Into<String>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
Sets the label of this input text. Replaces the current value as set in Self::new
.
Sourcepub fn custom_id(self, id: impl Into<String>) -> Self
pub fn custom_id(self, id: impl Into<String>) -> Self
Sets the custom id of the input text, a developer-defined identifier. Replaces the current
value as set in Self::new
.
Sourcepub fn placeholder(self, label: impl Into<String>) -> Self
pub fn placeholder(self, label: impl Into<String>) -> Self
Sets the placeholder of this input text.
Sourcepub fn min_length(self, min: u16) -> Self
pub fn min_length(self, min: u16) -> Self
Sets the minimum length required for the input text
Sourcepub fn max_length(self, max: u16) -> Self
pub fn max_length(self, max: u16) -> Self
Sets the maximum length required for the input text
Trait Implementations§
Source§impl Clone for CreateInputText
impl Clone for CreateInputText
Source§fn clone(&self) -> CreateInputText
fn clone(&self) -> CreateInputText
Returns a copy 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 CreateInputText
impl Debug for CreateInputText
Source§impl PartialEq for CreateInputText
impl PartialEq for CreateInputText
Source§impl Serialize for CreateInputText
impl Serialize for CreateInputText
impl StructuralPartialEq for CreateInputText
Auto Trait Implementations§
impl Freeze for CreateInputText
impl RefUnwindSafe for CreateInputText
impl Send for CreateInputText
impl Sync for CreateInputText
impl Unpin for CreateInputText
impl UnwindSafe for CreateInputText
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