pub struct ServerStreamingCall<T> { /* private fields */ }Expand description
Receiving half of a server-streaming or bidirectional client call.
Implementations§
Source§impl<T: 'static> ServerStreamingCall<T>
impl<T: 'static> ServerStreamingCall<T>
Sourcepub fn new<D: StreamDriver<Receive = T> + 'static>(driver: D) -> Self
pub fn new<D: StreamDriver<Receive = T> + 'static>(driver: D) -> Self
Wraps a call whose unary request was sent and half-closed by its driver.
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.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ServerStreamingCall<T>
impl<T> !Send for ServerStreamingCall<T>
impl<T> !Sync for ServerStreamingCall<T>
impl<T> !UnwindSafe for ServerStreamingCall<T>
impl<T> Freeze for ServerStreamingCall<T>
impl<T> Unpin for ServerStreamingCall<T>
impl<T> UnsafeUnpin for ServerStreamingCall<T>where
Box<dyn Receive<T>>: UnsafeUnpin,
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