pub struct ValidityFlags {
pub value_missing: bool,
pub type_mismatch: bool,
pub pattern_mismatch: bool,
pub too_long: bool,
pub too_short: bool,
pub range_overflow: bool,
pub range_underflow: bool,
pub step_mismatch: bool,
pub bad_input: bool,
pub custom_error: bool,
}Expand description
ValidityState(HTML5 制約検証)の個別フラグ。以前は element.validity が
valid/valueMissing/customError の3つしか公開せず、input.validity. patternMismatch/.typeMismatch/.rangeOverflow 等、特定の制約だけを狙い撃ちして
カスタムエラーメッセージを出し分ける定番パターンが常に undefined(falsy)に
なっていた。
Fields§
§value_missing: bool§type_mismatch: bool§pattern_mismatch: bool§too_long: bool§too_short: bool§range_overflow: bool§range_underflow: bool§step_mismatch: bool§bad_input: bool§custom_error: boolImplementations§
Trait Implementations§
Source§impl Default for ValidityFlags
impl Default for ValidityFlags
Source§fn default() -> ValidityFlags
fn default() -> ValidityFlags
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ValidityFlags
impl RefUnwindSafe for ValidityFlags
impl Send for ValidityFlags
impl Sync for ValidityFlags
impl Unpin for ValidityFlags
impl UnsafeUnpin for ValidityFlags
impl UnwindSafe for ValidityFlags
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