pub struct ClientStreamingCall<Req, Resp> { /* private fields */ }Expand description
Client-streaming requests with exactly one response after successful completion.
Implementations§
Source§impl<Req: 'static, Resp: 'static> ClientStreamingCall<Req, Resp>
impl<Req: 'static, Resp: 'static> ClientStreamingCall<Req, Resp>
pub fn new<D: StreamDriver<Send = Req, Receive = Resp> + 'static>( driver: D, ) -> Self
Sourcepub fn send(&mut self, value: &Req) -> Result<(), StreamError>
pub fn send(&mut self, value: &Req) -> Result<(), StreamError>
Sends a message, waiting for transport capacity.
§Errors
Returns a closed-direction or terminal failure.
Sourcepub fn try_send(&mut self, value: &Req) -> Result<(), StreamError>
pub fn try_send(&mut self, value: &Req) -> Result<(), StreamError>
Attempts a send; pending means the message was not accepted.
§Errors
Returns pending, closed-direction or terminal failure.
Sourcepub fn half_close(&mut self) -> Result<(), StreamError>
pub fn half_close(&mut self) -> Result<(), StreamError>
Idempotently half-closes requests while allowing further responses.
§Errors
Returns a terminal failure.
Sourcepub fn try_half_close(&mut self) -> Result<(), StreamError>
pub fn try_half_close(&mut self) -> Result<(), StreamError>
Sourcepub fn try_finish(&mut self) -> Result<Resp, StreamError>
pub fn try_finish(&mut self) -> Result<Resp, StreamError>
Advances completion by at most two receive steps, preserving a pending response.
§Errors
Returns pending, terminal error, or response cardinality failure.
Sourcepub fn try_recv_next(&mut self) -> Result<Option<Resp>, StreamError>
pub fn try_recv_next(&mut self) -> Result<Option<Resp>, StreamError>
Polls the single response through validated final status.
§Errors
Returns the same pending or terminal errors as Self::try_finish.
Sourcepub fn recv_next(&mut self) -> Result<Option<Resp>, StreamError>
pub fn recv_next(&mut self) -> Result<Option<Resp>, StreamError>
Waits for the single response, then returns EOF on subsequent reads.
§Errors
Returns the terminal errors from Self::finish.
Sourcepub fn finish(&mut self) -> Result<Resp, StreamError>
pub fn finish(&mut self) -> Result<Resp, StreamError>
Waits for exactly one response and a successful final status.
§Errors
Returns terminal failure or response cardinality failure.
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.