Trait server_fn::codec::Encoding

source ·
pub trait Encoding {
    const CONTENT_TYPE: &'static str;
    const METHOD: Method;
}
Expand description

Defines a particular encoding format, which can be used for serializing or deserializing data.

Required Associated Constants§

source

const CONTENT_TYPE: &'static str

The MIME type of the data.

source

const METHOD: Method

The HTTP method used for requests.

This should be POST in most cases.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Encoding for Cbor

source§

const CONTENT_TYPE: &'static str = "application/cbor"

source§

const METHOD: Method = Method::POST

source§

impl Encoding for GetUrl

source§

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

source§

const METHOD: Method = Method::GET

source§

impl Encoding for Json

source§

const CONTENT_TYPE: &'static str = "application/json"

source§

const METHOD: Method = Method::POST

source§

impl Encoding for MsgPack

source§

const CONTENT_TYPE: &'static str = "application/msgpack"

source§

const METHOD: Method = Method::POST

source§

impl Encoding for MultipartFormData

source§

const CONTENT_TYPE: &'static str = "multipart/form-data"

source§

const METHOD: Method = Method::POST

source§

impl Encoding for PostUrl

source§

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

source§

const METHOD: Method = Method::POST

source§

impl Encoding for Rkyv

source§

const CONTENT_TYPE: &'static str = "application/rkyv"

source§

const METHOD: Method = Method::POST

source§

impl Encoding for SerdeLite

source§

const CONTENT_TYPE: &'static str = "application/json"

source§

const METHOD: Method = Method::POST

source§

impl Encoding for Streaming

source§

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

source§

const METHOD: Method = Method::POST

source§

impl Encoding for StreamingJson

source§

const CONTENT_TYPE: &'static str = Streaming::CONTENT_TYPE

source§

const METHOD: Method = Streaming::METHOD

source§

impl Encoding for StreamingText

source§

const CONTENT_TYPE: &'static str = "text/plain"

source§

const METHOD: Method = Method::POST