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

pub trait MessageBody {
    fn size(&self) -> BodySize;
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

fn size(&self) -> BodySize

fn poll_next(
    self: Pin<&mut Self>,
    cx: &mut Context
) -> Poll<Option<Result<Bytes, Error>>>

Loading content...

Methods

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 String[src]

impl MessageBody for ()[src]

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

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

impl MessageBody for Vec<u8>[src]

impl MessageBody for &'static str[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]

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, E> where
    E: Into<Error>,
    S: Stream<Item = Result<Bytes, E>> + Unpin
[src]

fn poll_next(
    self: Pin<&mut BodyStream<S, E>>,
    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...