pub struct BidiStreamingCall<Req, Resp> { /* private fields */ }Expand description
Independent request and response directions for a bidirectional client call.
Implementations§
Source§impl<Req: 'static, Resp: 'static> BidiStreamingCall<Req, Resp>
impl<Req: 'static, Resp: 'static> BidiStreamingCall<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_recv_next(&mut self) -> Result<Option<Resp>, StreamError>
pub fn try_recv_next(&mut self) -> Result<Option<Resp>, StreamError>
Sourcepub fn recv_next(&mut self) -> Result<Option<Resp>, StreamError>
pub fn recv_next(&mut self) -> Result<Option<Resp>, StreamError>
Sourcepub fn finish(&mut self) -> Result<Vec<Resp>, StreamError>
pub fn finish(&mut self) -> Result<Vec<Resp>, StreamError>
Half-closes requests and returns all remaining responses through completion.
§Errors
Returns terminal 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.
Auto Trait Implementations§
impl<Req, Resp> !RefUnwindSafe for BidiStreamingCall<Req, Resp>
impl<Req, Resp> !Send for BidiStreamingCall<Req, Resp>
impl<Req, Resp> !Sync for BidiStreamingCall<Req, Resp>
impl<Req, Resp> !UnwindSafe for BidiStreamingCall<Req, Resp>
impl<Req, Resp> Freeze for BidiStreamingCall<Req, Resp>
impl<Req, Resp> Unpin for BidiStreamingCall<Req, Resp>
impl<Req, Resp> UnsafeUnpin for BidiStreamingCall<Req, Resp>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more