Trait leptos_router::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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> FromFormData for T