pub struct Response {
pub status: StatusCode,
pub version: Version,
pub headers: HeaderMap<HeaderValue>,
pub body: Body,
}
Expand description
Http response type of roa.
Fields§
§status: StatusCode
Status code.
version: Version
Version of HTTP protocol.
headers: HeaderMap<HeaderValue>
Raw header map.
body: Body
Response body.
Methods from Deref<Target = Body>§
Sourcepub fn write_stream(
&mut self,
stream: impl Stream<Item = Result<Bytes>> + Sync + Send + 'static,
) -> &mut Self
pub fn write_stream( &mut self, stream: impl Stream<Item = Result<Bytes>> + Sync + Send + 'static, ) -> &mut Self
Write stream.
Sourcepub fn write_reader(
&mut self,
reader: impl AsyncRead + Sync + Send + Unpin + 'static,
) -> &mut Self
pub fn write_reader( &mut self, reader: impl AsyncRead + Sync + Send + Unpin + 'static, ) -> &mut Self
Write reader with default chunk size.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Response
impl !RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl !UnwindSafe for Response
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