pub enum Body {
Bytes(Vec<u8, Global>),
Stream {
size_hint: Option<usize>,
stream: Pin<Box<dyn Stream<Item = Result<BodyComponent, Error>> + Send + Sync, Global>>,
},
}Variants§
Implementations§
source§impl Body
impl Body
pub fn new() -> Body
pub fn empty() -> Body
pub fn bytes_and_trailers(bytes: Vec<u8, Global>, trailers: HeaderMap) -> Body
pub fn trailers(trailers: HeaderMap) -> Body
pub async fn collect( self ) -> impl Future<Output = Result<Vec<u8, Global>, Error>>
pub fn into_stream( self ) -> Pin<Box<dyn Stream<Item = Result<BodyComponent, Error>> + Send + Sync, Global>>
Trait Implementations§
source§impl From<Pin<Box<dyn Stream<Item = Result<BodyComponent, Error>> + Send + Sync, Global>>> for Body
impl From<Pin<Box<dyn Stream<Item = Result<BodyComponent, Error>> + Send + Sync, Global>>> for Body
Auto Trait Implementations§
impl !RefUnwindSafe for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl !UnwindSafe for Body
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more