Trait leptos_router::FromFormData
source · pub trait FromFormDatawhere
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§
sourcefn from_event(ev: &Event) -> Result<Self, FromFormDataError>
fn from_event(ev: &Event) -> Result<Self, FromFormDataError>
Tries to deserialize the data, given only the submit
event.
sourcefn from_form_data(form_data: &FormData) -> Result<Self, Error>
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.