Trait tonic::IntoStreamingRequest [−][src]
Trait implemented by RPC streaming request types.
Types implementing this trait can be used as arguments to client streaming
RPC methods without explicitly wrapping them into tonic::Request
s. The
purpose is to make client calls slightly more convenient to write.
Tonic’s code generation and blanket implementations handle this for you, so it is not necessary to implement this trait directly.
Example
Given the following gRPC service method definition:
rpc RecordRoute(stream Point) returns (RouteSummary) {}
we can call record_route
in two equivalent ways:
use tonic::Request; use futures_util::stream; let messages = vec![Point {}, Point {}]; client.record_route(Request::new(stream::iter(messages.clone()))); client.record_route(stream::iter(messages));
Associated Types
type Stream: Stream<Item = Self::Message> + Send + Sync + 'static
[src]
The RPC request stream type
type Message
[src]
The RPC request type
Required methods
fn into_streaming_request(self) -> Request<Self::Stream>
[src]
Wrap the stream of messages in a tonic::Request
Implementors
impl<T> IntoStreamingRequest for Request<T> where
T: Stream + Send + Sync + 'static,
[src]
T: Stream + Send + Sync + 'static,
impl<T> IntoStreamingRequest for T where
T: Stream + Send + Sync + 'static,
[src]
T: Stream + Send + Sync + 'static,