Struct StreamBody

pub struct StreamBody<S> { /* private fields */ }

A body created from a Stream.

Implementations

impl<S> StreamBody<S>

fn new(stream: S) -> Self

Create a new StreamBody.

Trait Implementations

impl<'__pin, S> Unpin for StreamBody<S> where PinnedFieldsOf<__Origin<'__pin, S>>: Unpin,

impl<S, D, E> Body for StreamBody<S> where S: Stream<Item = Result<Frame<D>, E>>, D: Buf,

type Data = D;
type Error = E;
fn poll_frame(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>>

impl<S: Clone> Clone for StreamBody<S>

fn clone(&self) -> StreamBody<S>

impl<S: Copy> Copy for StreamBody<S>

impl<S: Debug> Debug for StreamBody<S>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<S: Stream> Stream for StreamBody<S>

type Item = <S as Stream>::Item;
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>
fn size_hint(&self) -> (usize, Option<usize>)

Auto Trait Implementations

impl<S> Freeze for StreamBody<S> where S: Freeze,

impl<S> RefUnwindSafe for StreamBody<S> where S: RefUnwindSafe,

impl<S> Send for StreamBody<S> where S: Send,

impl<S> Sync for StreamBody<S> where S: Sync,

impl<S> UnsafeUnpin for StreamBody<S> where S: UnsafeUnpin,

impl<S> UnwindSafe for StreamBody<S> where S: UnwindSafe,

Blanket Implementations

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

type Ok = T;
type Error = E;
fn try_poll_next(self: Pin<&mut S>, cx: &mut Context<'_>) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>

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

fn type_id(&self) -> TypeId

impl<T> BodyExt for StreamBody<S> where T: Body + ?Sized,

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

fn borrow(&self) -> &T

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

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

impl<T> CloneToUninit for StreamBody<S> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for StreamBody<S>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for StreamBody<S> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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