Skip to main content

FormInput

Trait FormInput 

Source
pub trait FormInput:
    DeserializeOwned
    + Validate<Context = ()>
    + Send {
    type View: FormView;
    type Ctx: FromRequestParts<AppState> + Send;

    // Required method
    fn to_view(&self, ctx: Self::Ctx, errors: FormErrors) -> Self::View;

    // Provided method
    fn normalize(&mut self) { ... }
}

Required Associated Types§

Source

type View: FormView

Source

type Ctx: FromRequestParts<AppState> + Send

Request context the error view needs beyond the input itself, such as the route’s team. () when the input alone fills the view.

Required Methods§

Source

fn to_view(&self, ctx: Self::Ctx, errors: FormErrors) -> Self::View

Provided Methods§

Source

fn normalize(&mut self)

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§