ProtobufRequestExt

Trait ProtobufRequestExt 

Source
pub trait ProtobufRequestExt
where Self: Sized,
{ // Required methods fn accept_protobuf(self) -> Self; fn protobuf<T: Message + Default>( self, value: T, ) -> Result<Self, EncodeError>; }
Expand description

Extension trait for the RequestBuilder

Required Methods§

Source

fn accept_protobuf(self) -> Self

Configure the request to accept a protobuf response. Sets the Accept header to application/protobuf

Source

fn protobuf<T: Message + Default>(self, value: T) -> Result<Self, EncodeError>

Set the request payload encoded as protobuf. Sets the Content-Type header to application/protobuf

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.

Implementations on Foreign Types§

Source§

impl ProtobufRequestExt for RequestBuilder

Source§

fn accept_protobuf(self) -> Self

Source§

fn protobuf<T: Message + Default>(self, value: T) -> Result<Self, EncodeError>

Implementors§