pub struct Form {
pub name: String,
pub method: String,
pub action: String,
pub inputs: Vec<Input>,
pub buttons: Vec<ButtonAction>,
}Expand description
A terminal-compatible form.
Fields§
§name: StringForm name or inferred description.
method: StringMethod such as GET or POST.
action: StringAction target.
inputs: Vec<Input>Form inputs.
Button actions associated with this form.
Implementations§
Source§impl Form
impl Form
Sourcepub fn form_method(&self) -> FormMethod
pub fn form_method(&self) -> FormMethod
Returns the parsed submission method.
Sourcepub fn submit(
&self,
base_url: Option<&IndexUrl>,
values: &[(&str, &str)],
) -> Result<FormSubmission, FormSubmitError>
pub fn submit( &self, base_url: Option<&IndexUrl>, values: &[(&str, &str)], ) -> Result<FormSubmission, FormSubmitError>
Validates and resolves a submission request.
Sourcepub fn validate(&self, values: &[(&str, &str)]) -> ValidationState
pub fn validate(&self, values: &[(&str, &str)]) -> ValidationState
Returns validation state for a set of field overrides.
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 UnsafeUnpin 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