pub struct FormValidationManager { /* private fields */ }Expand description
The outcome of the last constraint validation, so a callback can ask why its control was rejected.
Replaced WHOLESALE on each validation rather than merged, which is what makes a control that has since been fixed stop reporting: it simply is not in the new map.
Implementations§
Source§impl FormValidationManager
impl FormValidationManager
pub fn new() -> Self
Sourcepub fn set_failures(
&mut self,
failures: impl IntoIterator<Item = (DomNodeId, ValidityState)>,
)
pub fn set_failures( &mut self, failures: impl IntoIterator<Item = (DomNodeId, ValidityState)>, )
Publish the result of one validation pass.
Sourcepub fn state_of(&self, node: DomNodeId) -> ValidityState
pub fn state_of(&self, node: DomNodeId) -> ValidityState
Why this control failed, or ValidityState::valid if it did not.
A control nothing has validated yet reads as VALID rather than as unknown. That is the honest answer for a form nobody has submitted - HTML says the same, since an untouched field is valid until a constraint check says otherwise.
Sourcepub fn failing_nodes(&self) -> Vec<DomNodeId>
pub fn failing_nodes(&self) -> Vec<DomNodeId>
Every control that failed the last validation, in document order.
Trait Implementations§
Source§impl Clone for FormValidationManager
impl Clone for FormValidationManager
Source§fn clone(&self) -> FormValidationManager
fn clone(&self) -> FormValidationManager
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 FormValidationManager
impl Debug for FormValidationManager
Source§impl Default for FormValidationManager
impl Default for FormValidationManager
Source§fn default() -> FormValidationManager
fn default() -> FormValidationManager
Returns the “default value” for a type. Read more
Source§impl PartialEq for FormValidationManager
impl PartialEq for FormValidationManager
impl StructuralPartialEq for FormValidationManager
Auto Trait Implementations§
impl Freeze for FormValidationManager
impl RefUnwindSafe for FormValidationManager
impl Send for FormValidationManager
impl Sync for FormValidationManager
impl Unpin for FormValidationManager
impl UnsafeUnpin for FormValidationManager
impl UnwindSafe for FormValidationManager
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