pub struct Form {
pub title: String,
pub fields: Vec<FormInputField>,
}Fields§
§title: String§fields: Vec<FormInputField>Implementations§
Source§impl Form
impl Form
pub fn new(title: impl Into<String>) -> Self
pub fn new_with_fields( title: impl Into<String>, fields: Vec<FormInputField>, ) -> Self
pub fn add_field(&mut self, field: FormInputField)
Sourcepub fn prompt(&mut self) -> bool
pub fn prompt(&mut self) -> bool
Prompt the user (or interaction handler) for the form input.
Updates the field’s values and returns whether the form was accepted or not.
pub fn get_field_with_name(&self, name: &str) -> Option<&FormInputField>
Trait Implementations§
impl Eq for Form
impl StructuralPartialEq for Form
Auto Trait Implementations§
impl Freeze for Form
impl RefUnwindSafe for Form
impl Send for Form
impl Sync for Form
impl Unpin for Form
impl UnwindSafe for Form
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more