Trait tower_web::response::Serializer[][src]

pub trait Serializer: Clone + Send + Sync + 'static + Sealed {
    type Format: Clone + Send + Sync + 'static;
    fn lookup(&self, name: &str) -> Option<ContentType<Self::Format>>;
fn serialize<T>(
        &self,
        value: &T,
        format: &Self::Format,
        context: &SerializerContext
    ) -> Result<Bytes, Error>
    where
        T: Serialize
; }

Serialize an HTTP response body

Serializer values use one or more Serde serializers to perform the actual serialization.

The Serializer values are also responsible for mapping content-type values to Serde serializers.

Associated Types

A token used by Serializer implementations to identify the specific serialization format to use when encoding a value.

Required Methods

Lookup a serializer and HeaderValue for the given Content-Type string.

Serialize the value using the specified format.

Implementations on Foreign Types

impl Serializer for ()
[src]

impl<T, U> Serializer for (T, U) where
    T: Serializer,
    U: Serializer
[src]

Implementors