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


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

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

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

impl<K, S, E, D> Discover for D where
    D: TryStream<Ok = Change<K, S>, Error = E> + ?Sized,
    K: Eq

type Key = K

A unique identifier for each active service. Read more

type Service = S

The type of Service yielded by this Discover. Read more

type Error = E

Error produced during discovery

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

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

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]