Skip to main content

Encoding

Trait Encoding 

Source
pub trait Encoding {
    // Required methods
    fn content_type(&self) -> HeaderValue;
    fn serializer<'a>(
        &self,
        w: &'a mut Vec<u8>,
    ) -> Box<dyn SerializerState<'a> + 'a>;
    fn deserializer<'a>(
        &self,
        buf: &'a [u8],
    ) -> Box<dyn DeserializerState<'a> + 'a>;
}
Expand description

An encoding of HTTP bodies.

Required Methods§

Source

fn content_type(&self) -> HeaderValue

The encoding’s MIME type.

Source

fn serializer<'a>( &self, w: &'a mut Vec<u8>, ) -> Box<dyn SerializerState<'a> + 'a>

Returns state which will serialize the response body into the provided buffer.

Source

fn deserializer<'a>(&self, buf: &'a [u8]) -> Box<dyn DeserializerState<'a> + 'a>

Returns state which will deserialize the request body from the provided buffer.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Encoding for conjure_http::client::JsonEncoding

Source§

impl Encoding for conjure_http::server::JsonEncoding

Source§

impl Encoding for conjure_http::client::SmileEncoding

Source§

impl Encoding for conjure_http::server::SmileEncoding