[−][src]Trait actix_web::body::MessageBody
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>>>
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
Implementations
impl dyn MessageBody + 'static
[src]
pub fn downcast_ref<T>(&self) -> Option<&T> where
T: 'static + MessageBody,
[src]
T: 'static + MessageBody,
Downcasts generic body to a specific type.
pub fn downcast_mut<T>(&mut self) -> Option<&mut T> where
T: 'static + MessageBody,
[src]
T: 'static + MessageBody,
Downcasts a generic body to a mutable specific type.
Implementations on Foreign Types
impl MessageBody for &'static str
[src]
fn size(&self) -> BodySize
[src]
fn poll_next(
self: Pin<&mut &'static str>,
&mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]
self: Pin<&mut &'static str>,
&mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
impl<B> MessageBody for Encoder<B> where
B: MessageBody,
[src]
B: MessageBody,
fn size(&self) -> BodySize
[src]
fn poll_next(
self: Pin<&mut Encoder<B>>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]
self: Pin<&mut Encoder<B>>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
impl MessageBody for String
[src]
fn size(&self) -> BodySize
[src]
fn poll_next(
self: Pin<&mut String>,
&mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]
self: Pin<&mut String>,
&mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
impl<T> MessageBody for Box<T> where
T: MessageBody + Unpin,
[src]
T: MessageBody + Unpin,
fn size(&self) -> BodySize
[src]
fn poll_next(
self: Pin<&mut Box<T>>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]
self: Pin<&mut Box<T>>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
impl MessageBody for ()
[src]
fn size(&self) -> BodySize
[src]
fn poll_next(
self: Pin<&mut ()>,
&mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]
self: Pin<&mut ()>,
&mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
impl MessageBody for Vec<u8>
[src]
fn size(&self) -> BodySize
[src]
fn poll_next(
self: Pin<&mut Vec<u8>>,
&mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]
self: Pin<&mut Vec<u8>>,
&mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
Implementors
impl MessageBody for Body
[src]
fn size(&self) -> BodySize
[src]
fn poll_next(
self: Pin<&mut Body>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]
self: Pin<&mut Body>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
impl MessageBody for Bytes
[src]
fn size(&self) -> BodySize
[src]
fn poll_next(
self: Pin<&mut Bytes>,
&mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]
self: Pin<&mut Bytes>,
&mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
impl MessageBody for BytesMut
[src]
fn size(&self) -> BodySize
[src]
fn poll_next(
self: Pin<&mut BytesMut>,
&mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]
self: Pin<&mut BytesMut>,
&mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
impl<B> MessageBody for ResponseBody<B> where
B: MessageBody,
[src]
B: MessageBody,
fn size(&self) -> BodySize
[src]
fn poll_next(
self: Pin<&mut ResponseBody<B>>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]
self: Pin<&mut ResponseBody<B>>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
impl<S> MessageBody for SizedStream<S> where
S: Stream<Item = Result<Bytes, Error>> + Unpin,
[src]
S: Stream<Item = Result<Bytes, Error>> + Unpin,
fn size(&self) -> BodySize
[src]
fn poll_next(
self: Pin<&mut SizedStream<S>>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]
self: Pin<&mut SizedStream<S>>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
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]
E: Into<Error>,
S: Stream<Item = Result<Bytes, E>> + Unpin,
fn size(&self) -> BodySize
[src]
fn poll_next(
self: Pin<&mut BodyStream<S, E>>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
[src]
self: Pin<&mut BodyStream<S, E>>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
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.