pub enum RequestBody {
PendingKnown(u64),
PendingUnknown,
StaticBytes(&'static [u8]),
StaticStr(&'static str),
Vec(Vec<u8>),
File(PathBuf, u64),
TempFile(TempFile, u64),
}Variants§
PendingKnown(u64)
PendingUnknown
StaticBytes(&'static [u8])
StaticStr(&'static str)
Vec(Vec<u8>)
File(PathBuf, u64)
TempFile(TempFile, u64)
Implementations§
Source§impl RequestBody
impl RequestBody
pub fn empty() -> Self
pub fn is_pending(&self) -> bool
pub fn is_empty(&self) -> Option<bool>
Sourcepub fn reader(&self) -> Result<BodyReader<'_>, Error>
pub fn reader(&self) -> Result<BodyReader<'_>, Error>
§Errors
Returns an error when the body is cached in a file and we fail to open the file.
Sourcepub async fn async_reader(&self) -> Result<BodyAsyncReader<'_>, Error>
pub async fn async_reader(&self) -> Result<BodyAsyncReader<'_>, Error>
§Errors
Returns an error when the body is cached in a file and we fail to open the file.
Trait Implementations§
Source§impl Clone for RequestBody
impl Clone for RequestBody
Source§fn clone(&self) -> RequestBody
fn clone(&self) -> RequestBody
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RequestBody
impl Debug for RequestBody
Source§impl From<&'static [u8]> for RequestBody
impl From<&'static [u8]> for RequestBody
Source§impl From<&'static str> for RequestBody
impl From<&'static str> for RequestBody
Source§impl From<String> for RequestBody
impl From<String> for RequestBody
Source§impl PartialEq for RequestBody
impl PartialEq for RequestBody
Source§impl TryFrom<RequestBody> for String
impl TryFrom<RequestBody> for String
impl Eq for RequestBody
impl StructuralPartialEq for RequestBody
Auto Trait Implementations§
impl Freeze for RequestBody
impl RefUnwindSafe for RequestBody
impl Send for RequestBody
impl Sync for RequestBody
impl Unpin for RequestBody
impl UnwindSafe 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