[][src]Trait actix_web::dev::MessageBody

pub trait MessageBody {
    pub fn size(&self) -> BodySize;
pub fn poll_next(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>
    ) -> Poll<Option<Result<Bytes, Error>>>; }

Type that provides this trait can be streamed to a peer.

Required methods

pub fn size(&self) -> BodySize[src]

pub fn poll_next(
    self: Pin<&mut Self>,
    cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]

Loading content...

Implementations

impl dyn MessageBody + 'static[src]

pub fn downcast_ref<T>(&self) -> Option<&T> where
    T: 'static + MessageBody
[src]

Downcasts generic body to a specific type.

pub fn downcast_mut<T>(&mut self) -> Option<&mut T> where
    T: 'static + MessageBody
[src]

Downcasts a generic body to a mutable specific type.

Implementations on Foreign Types

impl MessageBody for ()[src]

impl<T> MessageBody for Box<T, Global> where
    T: MessageBody + Unpin
[src]

impl MessageBody for String[src]

impl MessageBody for &'static str[src]

impl MessageBody for Vec<u8, Global>[src]

impl<B> MessageBody for Encoder<B> where
    B: MessageBody
[src]

Loading content...

Implementors

impl MessageBody for Body[src]

impl MessageBody for Bytes[src]

impl MessageBody for BytesMut[src]

impl<B> MessageBody for ResponseBody<B> where
    B: MessageBody
[src]

impl<S> MessageBody for SizedStream<S> where
    S: Stream<Item = Result<Bytes, Error>> + Unpin
[src]

pub fn poll_next(
    self: Pin<&mut SizedStream<S>>,
    cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]

Attempts to pull out the next value of the underlying Stream.

Empty values are skipped to prevent SizedStream's transmission being ended on a zero-length chunk, but rather proceed until the underlying Stream ends.

impl<S, E> MessageBody for BodyStream<S> where
    E: Into<Error>,
    S: Stream<Item = Result<Bytes, E>> + Unpin
[src]

pub fn poll_next(
    self: Pin<&mut BodyStream<S>>,
    cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]

Attempts to pull out the next value of the underlying Stream.

Empty values are skipped to prevent BodyStream's transmission being ended on a zero-length chunk, but rather proceed until the underlying Stream ends.

Loading content...