Struct ClientTransaction
pub struct ClientTransaction<'a, IO> { /* private fields */ }icap and std only.Expand description
A streaming ICAP request body being sent by a client.
Implementations§
§impl<'a, IO> ClientTransaction<'a, IO>
impl<'a, IO> ClientTransaction<'a, IO>
pub async fn write_data(&mut self, data: &[u8]) -> Result<WriteOutcome, Error>
pub async fn write_data(&mut self, data: &[u8]) -> Result<WriteOutcome, Error>
Write one entity-body data segment as an ICAP chunk.
Preview segments may not exceed the advertised Preview limit. The caller retains ownership of the source body and decides how to replay preview bytes after a final 204 or 206 response.
pub async fn monitor_response(&mut self) -> Result<WriteOutcome, Error>
pub async fn monitor_response(&mut self) -> Result<WriteOutcome, Error>
Wait for an early final response while the body source is idle.
write_data monitors the read side while each
segment is written. Callers waiting asynchronously for the next source
segment must race that wait with this method so early ICAP responses are
always consumed. The transaction keeps accepting body data after a
non-closing, bodyless response. A body-bearing response automatically
takes the transport-close fallback so its body can be streamed.
pub async fn finish(self) -> Result<ClientResponse<'a, IO>, Error>
pub async fn finish(self) -> Result<ClientResponse<'a, IO>, Error>
Finish a non-Preview request and read its final response head.
pub async fn finish_with_trailers(
self,
trailers: &TrailerBlock,
) -> Result<ClientResponse<'a, IO>, Error>
pub async fn finish_with_trailers( self, trailers: &TrailerBlock, ) -> Result<ClientResponse<'a, IO>, Error>
Finish a non-Preview request with negotiated HTTP trailers.
pub async fn abandon(self) -> Result<ClientResponse<'a, IO>, Error>
pub async fn abandon(self) -> Result<ClientResponse<'a, IO>, Error>
Stop sending after an early final response and close the write side.
Finishing a bodyless response path is preferred. This explicit fallback satisfies the ICAP requirement to terminate the transport when the remainder is not sent. Body-bearing early responses already take this fallback automatically.
pub async fn finish_preview(
self,
end_of_body: bool,
) -> Result<PreviewOutcome<'a, IO>, Error>
pub async fn finish_preview( self, end_of_body: bool, ) -> Result<PreviewOutcome<'a, IO>, Error>
Finish a Preview and read either 100 Continue or a final response.
Set end_of_body only when the supplied preview contains the complete
entity body. This emits the ieof terminal extension.
pub async fn finish_preview_with_trailers(
self,
end_of_body: bool,
trailers: &TrailerBlock,
) -> Result<PreviewOutcome<'a, IO>, Error>
pub async fn finish_preview_with_trailers( self, end_of_body: bool, trailers: &TrailerBlock, ) -> Result<PreviewOutcome<'a, IO>, Error>
Finish a Preview with negotiated HTTP trailers.
Trait Implementations§
§impl<IO> ExtensionsRef for ClientTransaction<'_, IO>
impl<IO> ExtensionsRef for ClientTransaction<'_, IO>
§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
Extensions storeAuto Trait Implementations§
impl<'a, IO> !Freeze for ClientTransaction<'a, IO>
impl<'a, IO> !UnwindSafe for ClientTransaction<'a, IO>
impl<'a, IO> RefUnwindSafe for ClientTransaction<'a, IO>where
&'a mut ClientConnection<IO>: RefUnwindSafe,
impl<'a, IO> Send for ClientTransaction<'a, IO>where
&'a mut ClientConnection<IO>: Send,
impl<'a, IO> Sync for ClientTransaction<'a, IO>where
&'a mut ClientConnection<IO>: Sync,
impl<'a, IO> Unpin for ClientTransaction<'a, IO>where
&'a mut ClientConnection<IO>: Unpin,
impl<'a, IO> UnsafeUnpin for ClientTransaction<'a, IO>where
&'a mut ClientConnection<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