Skip to main content

ServerStreamingCall

Struct ServerStreamingCall 

Source
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>

Source

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.

Source

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).

Source

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.

Source

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.

Source

pub fn initial_metadata(&self) -> Result<Option<Metadata>, StreamError>

Copies received initial metadata, if available.

§Errors

Rejects reentrant access from a driver callback.

Source

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.

Source

pub fn cancel(&mut self) -> Result<(), StreamError>

Cancels local resources without waiting for peer acknowledgement.

§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>
where Box<dyn Receive<T>>: Freeze,

§

impl<T> Unpin for ServerStreamingCall<T>
where Box<dyn Receive<T>>: Unpin,

§

impl<T> UnsafeUnpin for ServerStreamingCall<T>
where Box<dyn Receive<T>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.