pub struct Response {
pub status: u16,
pub headers: Vec<(String, String)>,
pub body: Data,
}Expand description
A response from an HTTP request.
The body is exposed as Data so bytes are only read when you need them.
Call Data::into_bytes to fully materialize the body, or read it in
chunks via the underlying buffer resource.
Fields§
§status: u16The HTTP status code.
headers: Vec<(String, String)>Response headers as name-value pairs.
body: DataThe response body. Read on demand to avoid unnecessary allocation.
Auto Trait Implementations§
impl !Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin 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