usecrate::{Body, SizeHint}; use bytes::{Buf, Bytes}; use http::HeaderMap; use pin_project_lite::pin_project; use std::borrow::Cow; use std::convert::{Infallible, TryFrom}; use std::pin::Pin; use std::task::{Context, Poll};
pin_project! { /// A body that consists of a single chunk. #[derive(Clone, Copy, Debug)] pubstruct Full<D> {
data: Option<D>,
}
}
impl<D> Full<D> where
D: Buf,
{ /// Create a new `Full`. pubfn new(data: D) -> Self { let data = if data.has_remaining() {
Some(data)
} else {
None
};
Full { data }
}
}
impl<D> Body for Full<D> where
D: Buf,
{ type Data = D; type Error = Infallible;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.