Trait Req

Source
pub trait Req: Serialize + DeserializeOwned {
    type Response: Serialize + DeserializeOwned;

    const METHOD: &'static str;

    // Required method
    fn path(&self) -> String;
}
Expand description

Describes a request. Any type that implements Req should be correctly handled if sent to the server with specified PATH and METHOD.

Required Associated Constants§

Source

const METHOD: &'static str

The method this request should be sent with.

Required Associated Types§

Source

type Response: Serialize + DeserializeOwned

The JSON body of response.

Required Methods§

Source

fn path(&self) -> String

The path this request should be sent to.

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 Req for EditPass

Source§

const METHOD: &'static str = "POST"

Source§

type Response = ()

Source§

impl Req for SignUp

Source§

const METHOD: &'static str = "POST"

Source§

type Response = ()