pub enum Body<S> {
Bytes {
content: Cow<'static, [u8]>,
content_type: Cow<'static, str>,
},
Form {
fields: Vec<(Cow<'static, str>, Cow<'static, str>)>,
},
Multipart {
parts: Vec<Part<S>>,
},
Stream {
stream: S,
content_type: Cow<'static, str>,
},
}
Expand description
Represents different types of HTTP request bodies.
This enum encapsulates the various body formats that can be sent in an HTTP request, including raw bytes, form data, and multipart forms.
Variants§
Bytes
Raw byte content with a specified content type.
Fields
Form
URL-encoded form data.
Fields
Multipart
Multipart form data, enabled with the “multipart” feature.
Stream
Streaming body data.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Body<S>where
S: Freeze,
impl<S> RefUnwindSafe for Body<S>where
S: RefUnwindSafe,
impl<S> Send for Body<S>where
S: Send,
impl<S> Sync for Body<S>where
S: Sync,
impl<S> Unpin for Body<S>where
S: Unpin,
impl<S> UnwindSafe for Body<S>where
S: UnwindSafe,
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