pub trait LocalAsyncSerializeRequest<'a, T, W> {
// Required methods
fn content_type(value: &T) -> HeaderValue;
fn serialize(value: T) -> Result<LocalAsyncRequestBody<'a, W>, Error>;
// Provided method
fn content_length(value: &T) -> Option<u64> { ... }
}Expand description
A trait implemented by request body serializers used by custom local 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<LocalAsyncRequestBody<'a, W>, Error>
fn serialize(value: T) -> Result<LocalAsyncRequestBody<'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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.