Struct ServerTransaction
pub struct ServerTransaction<'a, IO> { /* private fields */ }icap and std only.Expand description
One inbound ICAP request and its response transaction.
Implementations§
§impl<'a, IO> ServerTransaction<'a, IO>
impl<'a, IO> ServerTransaction<'a, IO>
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 request-body data segment.
A returned segment may be smaller than the peer’s wire chunk. When a
Preview ends without ieof, this returns None and
body_end returns BodyEnd::Preview.
pub const fn body_end(&self) -> Option<BodyEnd>
pub const fn body_end(&self) -> Option<BodyEnd>
Return the terminal state after next_data returns None.
pub fn trailers(&self) -> Option<&TrailerBlock>
pub fn trailers(&self) -> Option<&TrailerBlock>
Return trailers from the most recently completed body segment.
pub async fn continue_preview(
&mut self,
response: Response,
) -> Result<(), Error>
pub async fn continue_preview( &mut self, response: Response, ) -> Result<(), Error>
Send a tagged 100 Continue response and read the post-Preview body.
pub async fn respond(
self,
response: Response,
) -> Result<ServerResponse<'a, IO>, Error>
pub async fn respond( self, response: Response, ) -> Result<ServerResponse<'a, IO>, Error>
Start the final response after reaching a request-body boundary.
pub async fn respond_early(
self,
response: Response,
) -> Result<ServerResponse<'a, IO>, Error>
pub async fn respond_early( self, response: Response, ) -> Result<ServerResponse<'a, IO>, Error>
Send a final response before the request body reaches a boundary.
The response writer discards the remaining request concurrently with response writes so a keep-alive connection can remain synchronized. Read any request data an adaptation needs before responding. A closing request or response instead uses the transport-close fallback permitted by the ICAP errata.
pub async fn respond_streaming(
self,
response: Response,
) -> Result<ServerResponse<'a, IO>, Error>
pub async fn respond_streaming( self, response: Response, ) -> Result<ServerResponse<'a, IO>, Error>
Start a final response while retaining the unread request body.
Unlike respond_early, response writes do not
discard request data to make progress. Use
ServerResponse::next_request_data between response writes to stream
an adapted body without buffering the complete request. The peer must
monitor for an early ICAP response while it transmits its request body,
as required by the ICAP errata.
Trait Implementations§
§impl<IO> ExtensionsRef for ServerTransaction<'_, IO>
impl<IO> ExtensionsRef for ServerTransaction<'_, IO>
§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
Extensions storeAuto Trait Implementations§
impl<'a, IO> !Freeze for ServerTransaction<'a, IO>
impl<'a, IO> !UnwindSafe for ServerTransaction<'a, IO>
impl<'a, IO> RefUnwindSafe for ServerTransaction<'a, IO>where
&'a mut ServerConnection<IO>: RefUnwindSafe,
impl<'a, IO> Send for ServerTransaction<'a, IO>where
&'a mut ServerConnection<IO>: Send,
impl<'a, IO> Sync for ServerTransaction<'a, IO>where
&'a mut ServerConnection<IO>: Sync,
impl<'a, IO> Unpin for ServerTransaction<'a, IO>where
&'a mut ServerConnection<IO>: Unpin,
impl<'a, IO> UnsafeUnpin for ServerTransaction<'a, IO>where
&'a mut ServerConnection<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