Trait conjure_http::client::AsyncSerializeRequest
source · pub trait AsyncSerializeRequest<'a, T, W> {
// Required methods
fn content_type(value: &T) -> HeaderValue;
fn serialize(value: T) -> Result<AsyncRequestBody<'a, W>, Error>;
// Provided method
fn content_length(value: &T) -> Option<u64> { ... }
}Expand description
A trait implemented by request body serializers used by custom async Conjure client trait implementations.
Required Methods§
sourcefn content_type(value: &T) -> HeaderValue
fn content_type(value: &T) -> HeaderValue
Returns the body’s content type.
sourcefn serialize(value: T) -> Result<AsyncRequestBody<'a, W>, Error>
fn serialize(value: T) -> Result<AsyncRequestBody<'a, W>, Error>
Serializes the body.
Provided Methods§
sourcefn content_length(value: &T) -> Option<u64>
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.