Skip to main content

ValidatableForm

Trait ValidatableForm 

Source
pub trait ValidatableForm<P, I>: Sized
where P: Validatable<I, Self>,
{ // Provided methods fn validate(&mut self) -> Option<P> { ... } fn new() -> Self { ... } fn into_input(self) -> I { ... } }
Expand description

Convenience methods available on every form type T<Form>.

Implemented by #[derive(Validatable)]; the methods delegate to Validatable.

Provided Methods§

Source

fn validate(&mut self) -> Option<P>

Validates the form, writing per-field messages back into it, and returns the plain value when everything is valid.

Source

fn new() -> Self

Creates a pristine form with default input values.

Source

fn into_input(self) -> I

Extracts the raw input, dropping validation results.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§