Skip to main content

Module form

Module form 

Source
Expand description

Form constraint validation - the ValidityState an Invalid event explains itself with. The rules live in azul_layout::form. Form constraint validation - the shared vocabulary for Invalid.

The RULES live in azul_layout::form, because they need the DOM and the text pipeline. What lives here is the ANSWER: which constraints a control failed, in a shape that crosses the C ABI and that a callback can read.

§Why this is a manager and not an EventData variant

The obvious design - and the one this item was originally filed against - is a new EventData::Validity(..). It does not work: CallbackInfo never sees the SyntheticEvent. It carries the hit node and read-only access to the LayoutWindow, and every other event payload an app can actually read is parked in a manager and fetched by an accessor (peek_raw_motion is the same shape). An EventData variant would have been an ABI addition that no application could observe.

Structs§

FormValidationManager
The outcome of the last constraint validation, so a callback can ask why its control was rejected.
ValidityState
Every constraint one control failed, at once.

Enums§

ValidityReason
Why a control failed validation.