pub struct HttpResponse {
pub status: u16,
pub body: Vec<u8>,
pub headers: Vec<(String, String)>,
}Expand description
A completed HTTP response.
The body is the raw response bytes. Image decoding is handled
separately by TileDecoder.
Fields§
§status: u16HTTP status code (e.g. 200, 404, 500).
body: Vec<u8>Response body bytes.
headers: Vec<(String, String)>Response headers as (name, value) pairs.
Implementations may leave this empty if the engine does not need response headers (which is the common case for tile fetching). The field exists for cache-control, ETag, and content-type inspection.
Implementations§
Source§impl HttpResponse
impl HttpResponse
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Whether the status code indicates success (2xx).
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Whether the status code indicates a client error (4xx).
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Whether the status code indicates a server error (5xx).
Trait Implementations§
Source§impl Clone for HttpResponse
impl Clone for HttpResponse
Source§fn clone(&self) -> HttpResponse
fn clone(&self) -> HttpResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HttpResponse
impl RefUnwindSafe for HttpResponse
impl Send for HttpResponse
impl Sync for HttpResponse
impl Unpin for HttpResponse
impl UnsafeUnpin for HttpResponse
impl UnwindSafe for HttpResponse
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