Skip to main content

ProtobufStreamRequest

Trait ProtobufStreamRequest 

Source
pub trait ProtobufStreamRequest {
    // Required methods
    fn protobuf_stream_body<S, T>(self, stream: S) -> RequestBuilder
       where T: Message + Send + 'static,
             S: Stream<Item = T> + Send + 'static;
    fn try_protobuf_stream_body<S, T, E>(self, stream: S) -> RequestBuilder
       where T: Message + Send + 'static,
             S: Stream<Item = Result<T, E>> + Send + 'static,
             E: Into<Box<dyn Error + Send + Sync>> + Send + 'static;
}
Available on crate feature protobuf only.
Expand description

Extension trait for reqwest::RequestBuilder that streams a protobuf request body.

See ReqwestStreamBody for the HTTP caveats that apply to every streamed request body.

Required Methods§

Source

fn protobuf_stream_body<S, T>(self, stream: S) -> RequestBuilder
where T: Message + Send + 'static, S: Stream<Item = T> + Send + 'static,

Streams stream as length-prefixed protobuf messages, setting Content-Type: application/x-protobuf-stream.

Source

fn try_protobuf_stream_body<S, T, E>(self, stream: S) -> RequestBuilder
where T: Message + Send + 'static, S: Stream<Item = Result<T, E>> + Send + 'static, E: Into<Box<dyn Error + Send + Sync>> + Send + 'static,

Streams a fallible stream as length-prefixed protobuf messages.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ProtobufStreamRequest for RequestBuilder

Source§

fn protobuf_stream_body<S, T>(self, stream: S) -> RequestBuilder
where T: Message + Send + 'static, S: Stream<Item = T> + Send + 'static,

Source§

fn try_protobuf_stream_body<S, T, E>(self, stream: S) -> RequestBuilder
where T: Message + Send + 'static, S: Stream<Item = Result<T, E>> + Send + 'static, E: Into<Box<dyn Error + Send + Sync>> + Send + 'static,

Implementors§