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>,
) -> RawResponse
pub fn from_bytes( status: StatusCode, headers: Headers, body: impl Into<Bytes>, ) -> RawResponse
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<T, F> From<RawResponse> for Response<T, F>
impl<T, F> From<RawResponse> for Response<T, F>
Source§fn from(raw: RawResponse) -> Response<T, F>
fn from(raw: RawResponse) -> Response<T, F>
Converts to this type from the input type.
Source§impl<T, F> From<Response<T, F>> for RawResponse
impl<T, F> From<Response<T, F>> for RawResponse
Source§fn from(response: Response<T, F>) -> RawResponse
fn from(response: Response<T, F>) -> RawResponse
Converts to this type from the input type.
Source§impl PartialEq for RawResponse
impl PartialEq for RawResponse
Source§impl Response for RawResponse
impl Response for RawResponse
Source§fn status(&self) -> StatusCode
fn status(&self) -> StatusCode
Get the
StatusCode from the response.Source§fn try_into_raw_response(self) -> impl Future<Output = Result<RawResponse>>
fn try_into_raw_response(self) -> impl Future<Output = Result<RawResponse>>
Collect into a
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Decompress response bodies. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more