document messagebody trait items

This commit is contained in:
Rob Ede 2021-04-14 03:23:15 +01:00
parent 1bfdfd1f41
commit 037ac80a32
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
1 changed files with 3 additions and 1 deletions

View File

@ -12,10 +12,12 @@ use crate::error::Error;
use super::BodySize; use super::BodySize;
/// Type that implement this trait can be streamed to a peer. /// An interface for response bodies.
pub trait MessageBody { pub trait MessageBody {
/// Body size hint.
fn size(&self) -> BodySize; fn size(&self) -> BodySize;
/// Attempt to pull out the next chunk of body bytes.
fn poll_next( fn poll_next(
self: Pin<&mut Self>, self: Pin<&mut Self>,
cx: &mut Context<'_>, cx: &mut Context<'_>,