pub struct ResponseBody { /* private fields */ }Expand description
An asynchronous stream representing the body of HTTP response.
Implementations§
Source§impl ResponseBody
impl ResponseBody
Sourcepub fn empty() -> ResponseBody
pub fn empty() -> ResponseBody
Create an instance of empty ResponseBody.
Sourcepub fn once<T>(body: T) -> ResponseBody
pub fn once<T>(body: T) -> ResponseBody
Create an instance of ResponseBody from a chunk of bytes.
Sourcepub fn wrap_stream<T>(stream: T) -> ResponseBody
pub fn wrap_stream<T>(stream: T) -> ResponseBody
Create an instance of ResponseBody from a Stream of bytes.
Trait Implementations§
Source§impl Debug for ResponseBody
impl Debug for ResponseBody
Source§impl Default for ResponseBody
impl Default for ResponseBody
Source§fn default() -> ResponseBody
fn default() -> ResponseBody
Returns the “default value” for a type. Read more
Source§impl From<&'static [u8]> for ResponseBody
impl From<&'static [u8]> for ResponseBody
Source§fn from(body: &'static [u8]) -> ResponseBody
fn from(body: &'static [u8]) -> ResponseBody
Converts to this type from the input type.
Source§impl From<&'static str> for ResponseBody
impl From<&'static str> for ResponseBody
Source§fn from(body: &'static str) -> ResponseBody
fn from(body: &'static str) -> ResponseBody
Converts to this type from the input type.
Source§impl From<()> for ResponseBody
impl From<()> for ResponseBody
Source§fn from(_: ()) -> ResponseBody
fn from(_: ()) -> ResponseBody
Converts to this type from the input type.
Source§impl From<Bytes> for ResponseBody
impl From<Bytes> for ResponseBody
Source§fn from(body: Bytes) -> ResponseBody
fn from(body: Bytes) -> ResponseBody
Converts to this type from the input type.
Source§impl From<String> for ResponseBody
impl From<String> for ResponseBody
Source§fn from(body: String) -> ResponseBody
fn from(body: String) -> ResponseBody
Converts to this type from the input type.
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more