Trait anterofit::serialize::Serializer[][src]

pub trait Serializer: Send + Sync + 'static {
    fn serialize<T: Serialize, W: Write>(
        &self,
        val: &T,
        write: &mut W
    ) -> Result<()>;
fn content_type(&self) -> Option<Mime>; }

A trait describing types which can concurrently serialize other types into byte-streams.

Required Methods

Serialize T to write, returning any errors.

Return the MIME type of the serialized content, if applicable.

Used to set the Content-Type header of the request this serializer is being used for.

Implementors