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§
Source§impl 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§
Source§impl Debug for ResponseBody
impl Debug for ResponseBody
Source§impl From<&'static [u8]> for ResponseBody
impl From<&'static [u8]> for ResponseBody
Source§impl From<&'static str> for ResponseBody
impl From<&'static str> for ResponseBody
Source§impl From<String> for ResponseBody
impl From<String> for ResponseBody
Source§impl PartialEq for ResponseBody
impl PartialEq for ResponseBody
Source§impl TryFrom<ResponseBody> for String
impl TryFrom<ResponseBody> for String
impl Eq for ResponseBody
Auto Trait Implementations§
impl !Freeze for ResponseBody
impl RefUnwindSafe for ResponseBody
impl Send for ResponseBody
impl Sync for ResponseBody
impl Unpin for ResponseBody
impl UnwindSafe for ResponseBody
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