pub struct Response {
pub status: u16,
pub headers: Vec<(String, String)>,
pub body: Vec<u8>,
pub url: String,
pub metrics: Option<Metrics>,
}Expand description
A complete HTTP response, body buffered in memory. For large downloads use fetch_to_file,
which streams to disk instead, or read a Client’s Body in chunks.
Fields§
§status: u16The HTTP status code. 4xx/5xx are delivered here, not as HttpError; only
transport-level failures error.
headers: Vec<(String, String)>Response headers in arrival order (duplicates preserved).
body: Vec<u8>§url: StringThe URL that answered, after redirects; empty where the platform does not report it.
metrics: Option<Metrics>Transfer metrics, where the platform reports them.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Forget for Response
impl Freeze for Response
impl Move 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