pub struct AsyncRawResponse { /* private fields */ }Expand description
A raw HTTP response with status, headers, and body.
Implementations§
Source§impl AsyncRawResponse
impl AsyncRawResponse
Sourcepub fn new(
status: StatusCode,
headers: Headers,
stream: Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send>>,
) -> AsyncRawResponse
pub fn new( status: StatusCode, headers: Headers, stream: Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send>>, ) -> AsyncRawResponse
Create a raw HTTP response from an asynchronous stream of bytes.
Sourcepub fn from_bytes(
status: StatusCode,
headers: Headers,
bytes: impl Into<Bytes>,
) -> AsyncRawResponse
pub fn from_bytes( status: StatusCode, headers: Headers, bytes: impl Into<Bytes>, ) -> AsyncRawResponse
Create a raw HTTP response from raw bytes.
Sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
Get the status code from the response.
Sourcepub fn deconstruct(self) -> (StatusCode, Headers, AsyncResponseBody)
pub fn deconstruct(self) -> (StatusCode, Headers, AsyncResponseBody)
Deconstruct the raw HTTP response into its components.
Sourcepub fn into_body(self) -> AsyncResponseBody
pub fn into_body(self) -> AsyncResponseBody
Get the AsyncResponseBody.
Sourcepub async fn try_into_raw_response(self) -> Result<RawResponse, Error>
pub async fn try_into_raw_response(self) -> Result<RawResponse, Error>
Read the entire body and convert into a RawResponse.
Trait Implementations§
Source§impl Debug for AsyncRawResponse
impl Debug for AsyncRawResponse
Source§impl<T> From<AsyncRawResponse> for AsyncResponse<T>
impl<T> From<AsyncRawResponse> for AsyncResponse<T>
Source§fn from(raw: AsyncRawResponse) -> AsyncResponse<T>
fn from(raw: AsyncRawResponse) -> AsyncResponse<T>
Converts to this type from the input type.
Source§impl<T> From<AsyncResponse<T>> for AsyncRawResponse
impl<T> From<AsyncResponse<T>> for AsyncRawResponse
Source§fn from(response: AsyncResponse<T>) -> AsyncRawResponse
fn from(response: AsyncResponse<T>) -> AsyncRawResponse
Converts to this type from the input type.
Source§impl Response for AsyncRawResponse
impl Response for AsyncRawResponse
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.Auto Trait Implementations§
impl !Freeze for AsyncRawResponse
impl !RefUnwindSafe for AsyncRawResponse
impl !Sync for AsyncRawResponse
impl !UnwindSafe for AsyncRawResponse
impl Send for AsyncRawResponse
impl Unpin for AsyncRawResponse
impl UnsafeUnpin for AsyncRawResponse
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> 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