Struct ClientResponse
pub struct ClientResponse<'a, IO> { /* private fields */ }http and icap only.Expand description
A typed, streaming response to an HTTP adaptation request.
Adapted HTTP heads retain zero-copy header-value slices from their ICAP
wire buffers. Entity data is exposed as ref-counted Bytes chunks. For a
negotiated 204 or 206 response, the stream transparently replays the
retained original body bytes required to produce the final HTTP message.
Implementations§
§impl<'a, IO> ClientResponse<'a, IO>
impl<'a, IO> ClientResponse<'a, IO>
pub const fn encapsulated(&self) -> Option<&Encapsulated>
pub const fn encapsulated(&self) -> Option<&Encapsulated>
Return the typed encapsulated HTTP metadata, when present.
pub fn original_request(&self) -> Option<&Request<()>>
pub fn original_request(&self) -> Option<&Request<()>>
Return the original HTTP request head for a REQMOD transaction.
pub fn original_response(&self) -> Option<&Response<()>>
pub fn original_response(&self) -> Option<&Response<()>>
Return the original HTTP response head for a RESPMOD transaction.
pub fn request(&self) -> Option<&Request<()>>
pub fn request(&self) -> Option<&Request<()>>
Return the resulting HTTP request head for a REQMOD transaction.
A 204 response reuses the retained original head. A body-only adapted result also reuses that head, while a headed result uses the encapsulated head. Proxy credentials promoted to the outer ICAP response are restored on the resulting HTTP request.
pub fn response(&self) -> Option<&Response<()>>
pub fn response(&self) -> Option<&Response<()>>
Return the resulting HTTP response head for a RESPMOD transaction.
A 204 response or body-only adapted result reuses the retained original head. Proxy challenges promoted to the outer ICAP response are restored on the resulting HTTP response.
pub async fn next_data(&mut self) -> Result<Option<Bytes>, Error>
pub async fn next_data(&mut self) -> Result<Option<Bytes>, Error>
Read the next zero-copy data segment of the resulting HTTP body.
Trailer frames are consumed and remain available through
trailers. Use next_frame to
receive trailers as a frame.
pub async fn next_frame(&mut self) -> Result<Option<Frame<Bytes>>, Error>
pub async fn next_frame(&mut self) -> Result<Option<Frame<Bytes>>, Error>
Read the next data or trailer frame of the resulting HTTP body.
This includes original-body replay for 204 and 206 responses.
pub const fn body_end(&self) -> Option<BodyEnd>
pub const fn body_end(&self) -> Option<BodyEnd>
Return the terminal ICAP body state after the data stream completes.
pub const fn trailers(&self) -> Option<&HeaderMap>
pub const fn trailers(&self) -> Option<&HeaderMap>
Return trailers of the resulting HTTP body after it completes.
pub fn icap_trailers(&self) -> Option<&TrailerBlock>
pub fn icap_trailers(&self) -> Option<&TrailerBlock>
Return negotiated outer ICAP trailers after the ICAP body completes.
These fields are ICAP metadata and are never emitted as HTTP trailer
frames by next_frame.
pub const fn original_body_bytes_sent(&self) -> u64
pub const fn original_body_bytes_sent(&self) -> u64
Return original entity-body bytes sent in complete ICAP chunks.
pub const fn original_body_len(&self) -> Option<u64>
pub const fn original_body_len(&self) -> Option<u64>
Return the exact original entity-body length, when known.
pub const fn original_body_offset_is_verified(&self) -> Option<bool>
pub const fn original_body_offset_is_verified(&self) -> Option<bool>
Return whether a 206 original-body offset was locally verified.
Trait Implementations§
§impl<IO> Debug for ClientResponse<'_, IO>
impl<IO> Debug for ClientResponse<'_, IO>
§impl<IO> ExtensionsRef for ClientResponse<'_, IO>
impl<IO> ExtensionsRef for ClientResponse<'_, IO>
§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
Extensions storeAuto Trait Implementations§
impl<'a, IO> !Freeze for ClientResponse<'a, IO>
impl<'a, IO> !RefUnwindSafe for ClientResponse<'a, IO>
impl<'a, IO> !UnwindSafe for ClientResponse<'a, IO>
impl<'a, IO> Send for ClientResponse<'a, IO>where
ClientResponse<'a, IO>: Send,
impl<'a, IO> Sync for ClientResponse<'a, IO>where
ClientResponse<'a, IO>: Sync,
impl<'a, IO> Unpin for ClientResponse<'a, IO>where
ClientResponse<'a, IO>: Unpin,
impl<'a, IO> UnsafeUnpin for ClientResponse<'a, IO>where
ClientResponse<'a, IO>: UnsafeUnpin,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more