Enum beatrice::RequestBody
source · [−]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
sourceimpl RequestBody
impl RequestBody
pub fn empty() -> Self
pub fn is_pending(&self) -> bool
pub fn length_is_known(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn len(&self) -> u64
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
sourceimpl Clone for RequestBody
impl Clone for RequestBody
sourcefn clone(&self) -> RequestBody
fn clone(&self) -> RequestBody
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RequestBody
impl Debug for RequestBody
sourceimpl From<&'static [u8]> for RequestBody
impl From<&'static [u8]> for RequestBody
sourceimpl From<&'static str> for RequestBody
impl From<&'static str> for RequestBody
sourceimpl From<String> for RequestBody
impl From<String> for RequestBody
sourceimpl PartialEq<RequestBody> for RequestBody
impl PartialEq<RequestBody> for RequestBody
sourcefn eq(&self, other: &RequestBody) -> bool
fn eq(&self, other: &RequestBody) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RequestBody) -> bool
fn ne(&self, other: &RequestBody) -> bool
This method tests for !=
.
sourceimpl TryFrom<RequestBody> for String
impl TryFrom<RequestBody> for String
sourceimpl TryFrom<RequestBody> for Vec<u8>
impl TryFrom<RequestBody> for Vec<u8>
impl Eq for RequestBody
impl StructuralEq for RequestBody
impl StructuralPartialEq for RequestBody
Auto Trait Implementations
impl RefUnwindSafe for RequestBody
impl Send for RequestBody
impl Sync for RequestBody
impl Unpin for RequestBody
impl UnwindSafe for RequestBody
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more