pub enum Body {
Bytes(Vec<u8>),
Stream {
size_hint: Option<usize>,
stream: BodyStream,
},
}Variants§
Implementations§
Source§impl Body
impl Body
pub fn new() -> Self
pub fn empty() -> Self
pub fn bytes_and_trailers(bytes: Vec<u8>, trailers: HeaderMap) -> Self
pub fn trailers(trailers: HeaderMap) -> Self
pub async fn collect(self) -> Result<Vec<u8>, Error>
pub fn into_stream( self, ) -> Pin<Box<dyn Stream<Item = Result<BodyComponent, Error>> + Send + Sync + 'static>>
Trait Implementations§
Source§impl From<Body> for BodyWrapper
impl From<Body> for BodyWrapper
Source§impl From<Pin<Box<dyn Stream<Item = Result<BodyComponent, Error>> + Sync + Send>>> for Body
impl From<Pin<Box<dyn Stream<Item = Result<BodyComponent, Error>> + Sync + Send>>> for Body
Source§fn from(stream: BodyStream) -> Self
fn from(stream: BodyStream) -> Self
Converts to this type from the input type.
Source§impl Into<Body> for BodyWrapper
impl Into<Body> for BodyWrapper
Auto Trait Implementations§
impl Freeze for Body
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