pub trait Payload: Send {
    const CONTENT_TYPE: &'static str;

    // Required method
    fn schema_ref() -> MetaSchemaRef;

    // Provided methods
    fn check_content_type(content_type: &str) -> bool { ... }
    fn register(registry: &mut Registry) { ... }
}
Expand description

Represents a payload type.

Required Associated Constants§

source

const CONTENT_TYPE: &'static str

The content type of this payload.

Required Methods§

source

fn schema_ref() -> MetaSchemaRef

Gets schema reference of this payload.

Provided Methods§

source

fn check_content_type(content_type: &str) -> bool

Check the content type of incoming request

source

fn register(registry: &mut Registry)

Register the schema contained in this payload to the registry.

Implementors§

source§

impl<T: Type> Payload for Form<T>

source§

const CONTENT_TYPE: &'static str = "application/x-www-form-urlencoded"

source§

impl<T: Type> Payload for Json<T>

source§

const CONTENT_TYPE: &'static str = "application/json; charset=utf-8"

source§

impl<T: Type> Payload for Xml<T>

source§

const CONTENT_TYPE: &'static str = "application/xml; charset=utf-8"

source§

impl<T: Type> Payload for Yaml<T>

source§

const CONTENT_TYPE: &'static str = "application/yaml; charset=utf-8"

source§

impl<T: Into<Body> + Send> Payload for Attachment<T>

source§

const CONTENT_TYPE: &'static str = Binary<T>::CONTENT_TYPE

source§

impl<T: Send> Payload for Base64<T>

source§

const CONTENT_TYPE: &'static str = "text/plain; charset=utf-8"

source§

impl<T: Send> Payload for Binary<T>

source§

const CONTENT_TYPE: &'static str = "application/octet-stream"

source§

impl<T: Send> Payload for Html<T>

source§

const CONTENT_TYPE: &'static str = "text/html; charset=utf-8"

source§

impl<T: Send> Payload for PlainText<T>

source§

const CONTENT_TYPE: &'static str = "text/plain; charset=utf-8"

source§

impl<T: Stream<Item = E> + Send + 'static, E: Type + ToJSON> Payload for EventStream<T>

source§

const CONTENT_TYPE: &'static str = "text/event-stream"