Skip to main content

RequestStream

Struct RequestStream 

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

Source

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

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.

Trait Implementations§

Source§

impl<Req> Deref for RequestStream<Req>

Source§

type Target = ServerStreamingCall<Req>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<Req> DerefMut for RequestStream<Req>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<Req> !RefUnwindSafe for RequestStream<Req>

§

impl<Req> !Send for RequestStream<Req>

§

impl<Req> !Sync for RequestStream<Req>

§

impl<Req> !UnwindSafe for RequestStream<Req>

§

impl<Req> Freeze for RequestStream<Req>

§

impl<Req> Unpin for RequestStream<Req>

§

impl<Req> UnsafeUnpin for RequestStream<Req>

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.