[][src]Trait gotham_restful::FromBody

pub trait FromBody: Sized {
    type Err: Into<ResourceError>;
    fn from_body(body: Chunk, content_type: Mime) -> Result<Self, Self::Err>;
}

This trait must be implemented by every type that can be used as a request body. It allows to create the type from a hyper body chunk and it's content type.

Associated Types

type Err: Into<ResourceError>

Loading content...

Required methods

fn from_body(body: Chunk, content_type: Mime) -> Result<Self, Self::Err>

Create the request body from a raw body and the content type.

Loading content...

Implementors

impl<T: DeserializeOwned> FromBody for T[src]

type Err = Error

Loading content...