FromFormData

Trait FromFormData 

Source
pub trait FromFormData
where Self: Sized + DeserializeOwned,
{ // Required methods fn from_event(ev: &Event) -> Result<Self, FromFormDataError>; fn from_form_data(form_data: &FormData) -> Result<Self, Error>; }
Expand description

Tries to deserialize a type from form data. This can be used for client-side validation during form submission.

Required Methods§

Source

fn from_event(ev: &Event) -> Result<Self, FromFormDataError>

Tries to deserialize the data, given only the submit event.

Source

fn from_form_data(form_data: &FormData) -> Result<Self, Error>

Tries to deserialize the data, given the actual form data.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> FromFormData for T