pub struct HttpResponse {
pub status_code: u32,
pub status_text: String,
pub headers: HashMap<String, String>,
pub body: Vec<u8>,
}Fields§
§status_code: u32§status_text: String§headers: HashMap<String, String>§body: Vec<u8>Implementations§
Source§impl HttpResponse
impl HttpResponse
pub fn is_success(&self) -> bool
pub fn text(&self) -> Result<String, FromUtf8Error>
pub fn json<T: DeserializeOwned>(&self) -> Result<T, Error>
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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpResponse
impl Debug for HttpResponse
Source§impl Default for HttpResponse
impl Default for HttpResponse
Source§fn default() -> HttpResponse
fn default() -> HttpResponse
Returns the “default value” for a type. Read more
Source§impl From<HttpResponse> for HttpResponse
impl From<HttpResponse> for HttpResponse
Source§fn from(resp: ProtoHttpResponse) -> Self
fn from(resp: ProtoHttpResponse) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for HttpResponse
impl RefUnwindSafe for HttpResponse
impl Send for HttpResponse
impl Sync for HttpResponse
impl Unpin for HttpResponse
impl UnwindSafe for HttpResponse
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)