StreamingResponse

Struct StreamingResponse 

Source
pub struct StreamingResponse<T: Send + 'static>(pub GrpcFuture<(Metadata, GrpcStreamWithTrailingMetadata<T>)>);
Expand description

Streaming response

Tuple Fields§

§0: GrpcFuture<(Metadata, GrpcStreamWithTrailingMetadata<T>)>

Initial metadata, stream of items followed by trailing metadata

Implementations§

Source§

impl<T: Send + 'static> StreamingResponse<T>

Source

pub fn new<F>(f: F) -> StreamingResponse<T>
where F: Future<Output = Result<(Metadata, GrpcStreamWithTrailingMetadata<T>)>> + Send + 'static,

Source

pub fn metadata_and_stream_and_trailing_metadata<S, M>( metadata: Metadata, result: S, trailing: M, ) -> StreamingResponse<T>
where S: Stream<Item = Result<T>> + Send + 'static, M: Future<Output = Result<Metadata>> + Send + 'static,

Source

pub fn metadata_and_stream<S>( metadata: Metadata, result: S, ) -> StreamingResponse<T>
where S: Stream<Item = Result<T>> + Send + 'static,

Source

pub fn no_metadata<S>(s: S) -> StreamingResponse<T>
where S: Stream<Item = Result<T>> + Send + 'static,

Source

pub fn completed_with_metadata_and_trailing_metadata( metadata: Metadata, r: Vec<T>, trailing: Metadata, ) -> StreamingResponse<T>

Source

pub fn completed_with_metadata( metadata: Metadata, r: Vec<T>, ) -> StreamingResponse<T>

Source

pub fn iter_with_metadata_and_trailing_metadata<I, M>( metadata: Metadata, iter: I, trailing: M, ) -> StreamingResponse<T>
where I: Iterator<Item = T> + Send + 'static, M: Future<Output = Result<Metadata>> + Send + 'static,

Source

pub fn iter_with_metadata<I>( metadata: Metadata, iter: I, ) -> StreamingResponse<T>
where I: Iterator<Item = T> + Send + 'static,

Source

pub fn completed(r: Vec<T>) -> StreamingResponse<T>

Source

pub fn iter<I>(iter: I) -> StreamingResponse<T>
where I: Iterator<Item = T> + Send + 'static,

Source

pub fn empty() -> StreamingResponse<T>

Source

pub fn err(err: Error) -> StreamingResponse<T>

Create an error response

Source

pub fn map_items<U, F>(self, f: F) -> StreamingResponse<U>
where U: Send + 'static, F: FnMut(T) -> U + Send + 'static,

Source

pub fn and_then_items<U, F>(self, f: F) -> StreamingResponse<U>
where U: Send + 'static, F: FnMut(T) -> Result<U> + Send + 'static,

Source

pub fn drop_metadata(self) -> GrpcStream<T>

Source

pub fn into_future(self) -> SingleResponse<Vec<T>>

Source

pub fn single(self) -> SingleResponse<T>

Take single element from stream

Source

pub fn collect(self) -> GrpcFuture<(Metadata, Vec<T>, Metadata)>

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.