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