Skip to main content

Validator

Type Alias Validator 

Source
pub type Validator<T> = Arc<dyn Fn(&T) -> Option<SharedString> + 'static>;
Expand description

validate — returns None when the value is acceptable, or the message to show when it is not.

v3 types this (value) => ValidationError | true | null | undefined, where a returned error marks the field invalid; None here is that null.

Aliased Type§

pub struct Validator<T> { /* private fields */ }