UpdateRequest

Trait UpdateRequest 

Source
pub trait UpdateRequest: Serialize + Debug {
    type Response: TryInto<Self::Output, Error = Error> + DeserializeOwned;
    type Output;

    // Required method
    fn endpoint(&self) -> Cow<'static, str>;

    // Provided methods
    fn content_type() -> &'static str { ... }
    fn body(&self) -> Result<Vec<u8>> { ... }
    fn method(&self) -> Method { ... }
}
Expand description

A request that does an update, by default the body is serialized as application/x-www-form-urlencoded and the method is POST

Required Associated Types§

Source

type Response: TryInto<Self::Output, Error = Error> + DeserializeOwned

The type returned by the Scoop.it API.

It must be convertible to this trait Output type.

Source

type Output

The type returned by the client

Required Methods§

Source

fn endpoint(&self) -> Cow<'static, str>

Provided Methods§

Source

fn content_type() -> &'static str

the content type of the post request, by default application/x-www-form-urlencoded

Source

fn body(&self) -> Result<Vec<u8>>

The body as bytes, by default the type implementing this trait is serialized using serde_qs.

Source

fn method(&self) -> Method

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§