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>> + Send + Sync, Global>>> for Body
impl From<Pin<Box<dyn Stream<Item = Result<BodyComponent, Error>> + Send + Sync, Global>>> 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 !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