Trait conjure_http::client::SerializeRequest

source ·
pub trait SerializeRequest<'a, T, W> {
    // Required methods
    fn content_type(value: &T) -> HeaderValue;
    fn serialize(value: T) -> Result<RequestBody<'a, W>, Error>;

    // Provided method
    fn content_length(value: &T) -> Option<u64> { ... }
}
Expand description

A trait implemented by request body serializers used by custom Conjure client trait implementations.

Required Methods§

source

fn content_type(value: &T) -> HeaderValue

Returns the body’s content type.

source

fn serialize(value: T) -> Result<RequestBody<'a, W>, Error>

Serializes the body.

Provided Methods§

source

fn content_length(value: &T) -> Option<u64>

Returns the body’s length, if known.

Empty and fixed size bodies will have their content length filled in automatically.

The default implementation returns None.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, T, W> SerializeRequest<'a, T, W> for ConjureRequestSerializer
where T: Serialize,