pub struct FormHandle { /* private fields */ }Expand description
Handle for interacting with form state
Implementations§
Source§impl FormHandle
impl FormHandle
Sourcepub fn register(&self, name: &str) -> FieldRegistration
pub fn register(&self, name: &str) -> FieldRegistration
Register a field and get its registration info
Sourcepub fn is_touched(&self, name: &str) -> bool
pub fn is_touched(&self, name: &str) -> bool
Check if a field has been touched
Sourcepub fn set_touched(&self, name: &str, is_touched: bool)
pub fn set_touched(&self, name: &str, is_touched: bool)
Mark a field as touched
Sourcepub fn validate_field(&self, name: &str, value: &str) -> bool
pub fn validate_field(&self, name: &str, value: &str) -> bool
Validate a specific field
Sourcepub fn validate_all(&self) -> bool
pub fn validate_all(&self) -> bool
Validate all fields in the form
Sourcepub fn is_submitting(&self) -> bool
pub fn is_submitting(&self) -> bool
Check if the form is currently submitting
Sourcepub fn get_values(&self) -> HashMap<String, String>
pub fn get_values(&self) -> HashMap<String, String>
Get all form values
Sourcepub fn get_all_values(&self) -> HashMap<String, String>
pub fn get_all_values(&self) -> HashMap<String, String>
Get all form values (alias for get_values)
Sourcepub fn get_errors(&self) -> HashMap<String, String>
pub fn get_errors(&self) -> HashMap<String, String>
Get all errors
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Check if the form has any errors
Trait Implementations§
Source§impl Clone for FormHandle
impl Clone for FormHandle
Auto Trait Implementations§
impl !RefUnwindSafe for FormHandle
impl !UnwindSafe for FormHandle
impl Freeze for FormHandle
impl Send for FormHandle
impl Sync for FormHandle
impl Unpin for FormHandle
impl UnsafeUnpin for FormHandle
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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