pub struct RawResponse { /* private fields */ }Expand description
A raw HTTP response with status, headers, and body.
Implementations§
Source§impl RawResponse
impl RawResponse
Sourcepub fn from_bytes(
status: StatusCode,
headers: Headers,
body: impl Into<Bytes>,
) -> Self
pub fn from_bytes( status: StatusCode, headers: Headers, body: impl Into<Bytes>, ) -> Self
Create an HTTP response from raw bytes.
Sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
Get the status code from the response.
Sourcepub fn body(&self) -> &ResponseBody
pub fn body(&self) -> &ResponseBody
Get the ResponseBody.
Sourcepub fn into_body(self) -> ResponseBody
pub fn into_body(self) -> ResponseBody
Get the ResponseBody.
Sourcepub fn deconstruct(self) -> (StatusCode, Headers, ResponseBody)
pub fn deconstruct(self) -> (StatusCode, Headers, ResponseBody)
Deconstruct the HTTP response into its components.
Trait Implementations§
Source§impl Clone for RawResponse
impl Clone for RawResponse
Source§fn clone(&self) -> RawResponse
fn clone(&self) -> RawResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RawResponse
impl Debug for RawResponse
impl Eq for RawResponse
Source§impl PartialEq for RawResponse
impl PartialEq for RawResponse
impl StructuralPartialEq for RawResponse
Auto Trait Implementations§
impl !Freeze for RawResponse
impl RefUnwindSafe for RawResponse
impl Send for RawResponse
impl Sync for RawResponse
impl Unpin for RawResponse
impl UnsafeUnpin for RawResponse
impl UnwindSafe for RawResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.