pub enum ValidateTrigger {
OnChange,
OnBlur,
Manual,
}Expand description
When Context::form_field runs a field’s
validators.
Defaults to OnBlur, matching the behavior of
huh and bubbles/textinput.
§Example
let field = FormField::new("Email")
.validate(validators::email())
.on_change(); // validate as the user types
assert_eq!(field.trigger, ValidateTrigger::OnChange);Variants§
OnChange
Validate on every value change (each keystroke).
OnBlur
Validate when the field loses focus. The default.
Manual
Never auto-validate; the app calls
FormState::validate_all or FormField::run_validators manually.
Trait Implementations§
Source§impl Clone for ValidateTrigger
impl Clone for ValidateTrigger
Source§fn clone(&self) -> ValidateTrigger
fn clone(&self) -> ValidateTrigger
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValidateTrigger
impl Debug for ValidateTrigger
Source§impl Default for ValidateTrigger
impl Default for ValidateTrigger
Source§fn default() -> ValidateTrigger
fn default() -> ValidateTrigger
Returns the “default value” for a type. Read more
Source§impl PartialEq for ValidateTrigger
impl PartialEq for ValidateTrigger
Source§fn eq(&self, other: &ValidateTrigger) -> bool
fn eq(&self, other: &ValidateTrigger) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ValidateTrigger
impl Eq for ValidateTrigger
impl StructuralPartialEq for ValidateTrigger
Auto Trait Implementations§
impl Freeze for ValidateTrigger
impl RefUnwindSafe for ValidateTrigger
impl Send for ValidateTrigger
impl Sync for ValidateTrigger
impl Unpin for ValidateTrigger
impl UnsafeUnpin for ValidateTrigger
impl UnwindSafe for ValidateTrigger
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.