pub struct Body { /* private fields */ }Expand description
An in-memory HTTP request body with an optional MIME type.
Cheaply cloneable; all body data is in a Vec<u8> so there is no async
reading involved.
Implementations§
Source§impl Body
impl Body
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Consume the body and return its bytes.
Sourcepub fn from_string(s: String) -> Self
pub fn from_string(s: String) -> Self
Create a body from a string with text/plain; charset=utf-8 content type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Body
impl RefUnwindSafe for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl UnsafeUnpin 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