pub enum RequestBody {
Empty,
Bytes(Vec<u8>),
Stream(LocalBoxStream<'static, Vec<u8>>),
}Expand description
A request body: nothing, an in-memory buffer, or a stream of chunks uploaded
incrementally with flow control (port of the TS BodyInit). Build one with
RequestBody::from(..) / .into() for buffers, or RequestBody::stream for
any Stream<Item = Vec<u8>> (streaming upload).
Variants§
Empty
No body; the request half-closes after HEADERS.
Bytes(Vec<u8>)
A complete in-memory body, framed and flow-controlled as it is sent.
Stream(LocalBoxStream<'static, Vec<u8>>)
A stream of body chunks, uploaded as they arrive.
Implementations§
Trait Implementations§
Source§impl Default for RequestBody
impl Default for RequestBody
Source§fn default() -> RequestBody
fn default() -> RequestBody
Returns the “default value” for a type. Read more
Source§impl From<&[u8]> for RequestBody
impl From<&[u8]> for RequestBody
Source§impl From<&str> for RequestBody
impl From<&str> for RequestBody
Source§impl From<String> for RequestBody
impl From<String> for RequestBody
Auto Trait Implementations§
impl !RefUnwindSafe for RequestBody
impl !Send for RequestBody
impl !Sync for RequestBody
impl !UnwindSafe for RequestBody
impl Freeze for RequestBody
impl Unpin for RequestBody
impl UnsafeUnpin for RequestBody
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