Enum beatrice::ResponseBody
source · [−]pub enum ResponseBody {
EventStream(Mutex<EventReceiver>),
StaticBytes(&'static [u8]),
StaticStr(&'static str),
Vec(Vec<u8>),
File(PathBuf, u64),
TempFile(TempFile, u64),
}
Variants
EventStream(Mutex<EventReceiver>)
StaticBytes(&'static [u8])
StaticStr(&'static str)
Vec(Vec<u8>)
File(PathBuf, u64)
TempFile(TempFile, u64)
Implementations
sourceimpl ResponseBody
impl ResponseBody
pub fn empty() -> Self
pub fn is_empty(&self) -> bool
pub fn len(&self) -> Option<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 Debug for ResponseBody
impl Debug for ResponseBody
sourceimpl From<&'static [u8]> for ResponseBody
impl From<&'static [u8]> for ResponseBody
sourceimpl From<&'static str> for ResponseBody
impl From<&'static str> for ResponseBody
sourceimpl From<String> for ResponseBody
impl From<String> for ResponseBody
sourceimpl PartialEq<ResponseBody> for ResponseBody
impl PartialEq<ResponseBody> for ResponseBody
sourceimpl TryFrom<ResponseBody> for String
impl TryFrom<ResponseBody> for String
sourceimpl TryFrom<ResponseBody> for Vec<u8>
impl TryFrom<ResponseBody> for Vec<u8>
impl Eq for ResponseBody
Auto Trait Implementations
impl RefUnwindSafe for ResponseBody
impl Send for ResponseBody
impl Sync for ResponseBody
impl Unpin for ResponseBody
impl UnwindSafe for ResponseBody
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