Struct tonic::Streaming[][src]

pub struct Streaming<T> { /* fields omitted */ }

Streaming requests and responses.

This will wrap some inner Body and Decoder and provide an interface to fetch the message stream and trailing metadata

Implementations

impl<T> Streaming<T>[src]

pub async fn message(&mut self) -> Result<Option<T>, Status>[src]

Fetch the next message from this stream.

if let Some(next_message) = request.message().await? {
    println!("{:?}", next_message);
}

pub async fn trailers(&mut self) -> Result<Option<MetadataMap>, Status>[src]

Fetch the trailing metadata.

This will drain the stream of all its messages to receive the trailing metadata. If Streaming::message returns None then this function will not need to poll for trailers since the body was totally consumed.

if let Some(metadata) = request.trailers().await? {
    println!("{:?}", metadata);
}

Trait Implementations

impl<T> Debug for Streaming<T>[src]

impl<T> Stream for Streaming<T>[src]

type Item = Result<T, Status>

Values yielded by the stream.

impl<T> Unpin for Streaming<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Streaming<T>

impl<T> Send for Streaming<T>

impl<T> Sync for Streaming<T>

impl<T> !UnwindSafe for Streaming<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<St> StreamExt for St where
    St: Stream + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> WithSubscriber for T[src]