LocalAsyncSerializeRequest

Trait LocalAsyncSerializeRequest 

Source
pub trait LocalAsyncSerializeRequest<'a, T, W> {
    // Required methods
    fn content_type(runtime: &ConjureRuntime, value: &T) -> HeaderValue;
    fn serialize(
        runtime: &ConjureRuntime,
        value: T,
    ) -> Result<LocalAsyncRequestBody<'a, W>, Error>;

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

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

Required Methods§

Source

fn content_type(runtime: &ConjureRuntime, value: &T) -> HeaderValue

Returns the body’s content type.

Source

fn serialize( runtime: &ConjureRuntime, value: T, ) -> Result<LocalAsyncRequestBody<'a, W>, Error>

Serializes the body.

Provided Methods§

Source

fn content_length(runtime: &ConjureRuntime, 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.

Implementors§