pub struct RequestStream<Req>(/* private fields */);Expand description
Inbound server requests, created together with a response sink by server_streams.
Request EOF half-closes inbound messages without closing the response sink.
Implementations§
Source§impl<Req: 'static> RequestStream<Req>
impl<Req: 'static> RequestStream<Req>
Sourcepub fn new<D: StreamDriver<Receive = Req> + 'static>(driver: D) -> Self
pub fn new<D: StreamDriver<Receive = Req> + 'static>(driver: D) -> Self
Wraps inbound requests without treating request EOF as response completion.
Methods from Deref<Target = ServerStreamingCall<Req>>§
Sourcepub fn try_recv_next(&mut self) -> Result<Option<T>, StreamError>
pub fn try_recv_next(&mut self) -> Result<Option<T>, StreamError>
Performs one nonblocking receive attempt.
§Errors
Returns pending or the sticky terminal failure; EOF is Ok(None).
Sourcepub fn recv_next(&mut self) -> Result<Option<T>, StreamError>
pub fn recv_next(&mut self) -> Result<Option<T>, StreamError>
Receives the next message, waiting for readiness on the caller thread.
§Errors
Returns a terminal RPC, transport or deadline failure.
Sourcepub fn finish(&mut self) -> Result<Vec<T>, StreamError>
pub fn finish(&mut self) -> Result<Vec<T>, StreamError>
Drains and returns remaining messages through validated completion.
§Errors
Returns a terminal failure, including missing successful trailers.
Sourcepub fn initial_metadata(&self) -> Result<Option<Metadata>, StreamError>
pub fn initial_metadata(&self) -> Result<Option<Metadata>, StreamError>
Copies received initial metadata, if available.
§Errors
Rejects reentrant access from a driver callback.
Sourcepub fn trailing_metadata(&self) -> Result<Option<Metadata>, StreamError>
pub fn trailing_metadata(&self) -> Result<Option<Metadata>, StreamError>
Copies terminal metadata, including on a remote failure.
§Errors
Rejects reentrant access from a driver callback.