#[repr(C)]pub enum ValidityReason {
ValueMissing = 0,
TooShort = 1,
TooLong = 2,
RangeUnderflow = 3,
RangeOverflow = 4,
PatternMismatch = 5,
}Expand description
Why a control failed validation.
Mirrors the flags HTML’s ValidityState exposes, minus the ones no
attribute azul understands can produce. New reasons are APPENDED - the
discriminant is a bit position in ValidityState, so renumbering would
silently change what a stored state means.
Variants§
ValueMissing = 0
required and the value is empty.
TooShort = 1
Shorter than minlength.
TooLong = 2
Longer than maxlength.
RangeUnderflow = 3
Below min.
RangeOverflow = 4
Above max.
PatternMismatch = 5
Does not match pattern (11b-i-b). The whole value must match, and an
empty value is exempt - both exactly as HTML’s patternMismatch.
Implementations§
Source§impl ValidityReason
impl ValidityReason
Sourcepub const fn bit(self) -> u32
pub const fn bit(self) -> u32
This reason’s bit in a ValidityState.
Trait Implementations§
Source§impl Clone for ValidityReason
impl Clone for ValidityReason
Source§fn clone(&self) -> ValidityReason
fn clone(&self) -> ValidityReason
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 moreimpl Copy for ValidityReason
Source§impl Debug for ValidityReason
impl Debug for ValidityReason
impl Eq for ValidityReason
Source§impl Hash for ValidityReason
impl Hash for ValidityReason
Source§impl Ord for ValidityReason
impl Ord for ValidityReason
Source§fn cmp(&self, other: &ValidityReason) -> Ordering
fn cmp(&self, other: &ValidityReason) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ValidityReason
impl PartialEq for ValidityReason
Source§impl PartialOrd for ValidityReason
impl PartialOrd for ValidityReason
impl StructuralPartialEq for ValidityReason
Auto Trait Implementations§
impl Freeze for ValidityReason
impl RefUnwindSafe for ValidityReason
impl Send for ValidityReason
impl Sync for ValidityReason
impl Unpin for ValidityReason
impl UnsafeUnpin for ValidityReason
impl UnwindSafe for ValidityReason
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