pub struct Response { /* private fields */ }Expand description
HTTP response from the outbound client.
Implementations§
Source§impl Response
impl Response
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
true if the status code is in the 200–299 range.
Sourcepub fn is_redirect(&self) -> bool
pub fn is_redirect(&self) -> bool
true if the status code is 301, 302, 303, 307, or 308.
Sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
Look up a response header by name (case-insensitive).
Sourcepub fn text(&self) -> Result<String, HttpClientError>
pub fn text(&self) -> Result<String, HttpClientError>
Decode the body as UTF-8.
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 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