Skip to main content

MutationForm

Trait MutationForm 

Source
pub trait MutationForm: DeserializeOwned {
    type Request: DeserializeOwned;

    // Required method
    fn into_request(self) -> Result<Self::Request, String>;
}
Expand description

A request shape that an HTML form can carry.

A browser form posts flat application/x-www-form-urlencoded pairs, so a request that holds a list needs a flat twin. Each mutation endpoint names the form shape it accepts, and the server turns that shape into the request the mutation takes. A request that is already flat is its own form shape.

Required Associated Types§

Source

type Request: DeserializeOwned

The request the mutation takes.

Required Methods§

Source

fn into_request(self) -> Result<Self::Request, String>

§Errors

Returns the reason the submitted form does not describe a request.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§