pub struct Form { /* private fields */ }Expand description
A form with multiple groups of fields.
Implementations§
Source§impl Form
impl Form
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Set the form description.
Sourcepub fn accessible(self, accessible: bool) -> Self
pub fn accessible(self, accessible: bool) -> Self
Enable accessible mode.
Sourcepub fn layout(self, layout: FormLayout) -> Self
pub fn layout(self, layout: FormLayout) -> Self
Set the form layout.
FormLayout::Default- Show one group at a time (default)FormLayout::Stack- Show all groups stacked verticallyFormLayout::Columns(n)- Show groups in n columns
Sourcepub fn get_layout(&self) -> FormLayout
pub fn get_layout(&self) -> FormLayout
Get the current layout.
Sourcepub fn is_submitted(&self) -> bool
pub fn is_submitted(&self) -> bool
Check if the form is submitted.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Check if the form is cancelled.
Sourcepub fn results(&self) -> FormResults
pub fn results(&self) -> FormResults
Get the form results.
Sourcepub fn current_group(&self) -> Option<&Group>
pub fn current_group(&self) -> Option<&Group>
Get the current group.
Sourcepub fn current_group_mut(&mut self) -> Option<&mut Group>
pub fn current_group_mut(&mut self) -> Option<&mut Group>
Get the current group mutably.
Source§impl Form
impl Form
Sourcepub fn run_accessible(&mut self) -> Result<Option<FormResults>>
pub fn run_accessible(&mut self) -> Result<Option<FormResults>>
Run the form in accessible mode.
This method handles the complete accessible flow, prompting for each field and advancing through groups automatically.
Returns the form results on success, or None if cancelled.
Trait Implementations§
Source§impl Accessible for Form
impl Accessible for Form
Source§fn accessible_prompt(&self) -> String
fn accessible_prompt(&self) -> String
Render the accessible prompt. Read more
Source§fn parse_accessible_input(&self, input: &str) -> Option<Self::Message>
fn parse_accessible_input(&self, input: &str) -> Option<Self::Message>
Parse accessible input and return a message. Read more
Source§fn is_accessible_complete(&self) -> bool
fn is_accessible_complete(&self) -> bool
Check if the component is complete (submitted or cancelled).
Source§impl Model for Form
impl Model for Form
Source§fn init(&self) -> Option<Cmd<Self::Message>>
fn init(&self) -> Option<Cmd<Self::Message>>
Initialize the model, returning an optional startup command. Read more
Source§fn update(&mut self, msg: Self::Message) -> Option<Cmd<Self::Message>>
fn update(&mut self, msg: Self::Message) -> Option<Cmd<Self::Message>>
Handle a message and update the model state. Read more
Source§fn handle_event(&self, event: Event) -> Option<Self::Message>
fn handle_event(&self, event: Event) -> Option<Self::Message>
Convert terminal events to messages. Read more
Source§fn subscriptions(&self) -> Sub<Self::Message>
fn subscriptions(&self) -> Sub<Self::Message>
Declare subscriptions for recurring events. Read more
Source§fn wants_tick(&self) -> bool
fn wants_tick(&self) -> bool
Whether this model should receive tick updates. Read more
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