Struct IncomingRequest
pub struct IncomingRequest { /* private fields */ }http and icap only.Expand description
An owned ICAP service request with typed HTTP heads and streaming body.
Pulling the body past an incomplete Preview boundary sends 100 Continue.
Returning a response before doing so rejects the remainder of the Preview.
Implementations§
§impl IncomingRequest
impl IncomingRequest
pub fn try_into_unchanged(self) -> Result<UnchangedRequest, IncomingRequest>
pub fn try_into_unchanged(self) -> Result<UnchangedRequest, IncomingRequest>
Convert this request into a checked unchanged-response capability.
The conversion selects a negotiated 204 response when legal. Otherwise it retains the untouched HTTP message for a streaming 200 echo. If mutable access may have changed or consumed data needed by that echo, the original request is returned unchanged.
pub fn respond_no_modification(
self,
service_tag: ServiceTag,
) -> Result<OutgoingResponse, Error>
pub fn respond_no_modification( self, service_tag: ServiceTag, ) -> Result<OutgoingResponse, Error>
Return a 204 response and leave the HTTP message unchanged.
§Contract
Do not return 204 after Preview has continued unless the request
contains Allow: 204.
pub fn respond_method_not_allowed(
self,
service_tag: ServiceTag,
) -> Result<OutgoingResponse, Error>
pub fn respond_method_not_allowed( self, service_tag: ServiceTag, ) -> Result<OutgoingResponse, Error>
Return a 405 response for this ICAP request method.
pub async fn adapt_response_head(
self,
service_tag: ServiceTag,
) -> Result<OutgoingResponse, Error>
pub async fn adapt_response_head( self, service_tag: ServiceTag, ) -> Result<OutgoingResponse, Error>
Return the current RESPMOD response head and preserve its body.
A non-empty body uses offset-zero 206 replay. The request must contain
both Allow: 204 and Allow: 206 because reading may continue Preview.
§impl IncomingRequest
impl IncomingRequest
pub fn from_icap(request: IncomingRequest) -> Result<IncomingRequest, Error>
pub fn from_icap(request: IncomingRequest) -> Result<IncomingRequest, Error>
Convert the protocol service input without buffering its entity body.
pub fn from_icap_with(
request: IncomingRequest,
parser: &HeadParser,
) -> Result<IncomingRequest, Error>
pub fn from_icap_with( request: IncomingRequest, parser: &HeadParser, ) -> Result<IncomingRequest, Error>
Convert the protocol input with explicit HTTP head parser bounds.
pub const fn encapsulated(&self) -> Option<&Encapsulated>
pub const fn encapsulated(&self) -> Option<&Encapsulated>
Return the typed encapsulated HTTP metadata, when present.
pub fn encapsulated_mut(&mut self) -> Option<&mut Encapsulated>
pub fn encapsulated_mut(&mut self) -> Option<&mut Encapsulated>
Return the mutable typed HTTP metadata, when present.
This conservatively makes a later streaming unchanged echo unavailable,
even when the caller only reads through the returned reference. Use
Self::encapsulated for read-only inspection.
pub fn body_mut(&mut self) -> &mut Body
pub fn body_mut(&mut self) -> &mut Body
Return the mutable streaming encapsulated entity body.
This conservatively records the body as exposed because polling through
the returned handle may consume bytes. A later Self::try_into_unchanged
can then neither use Preview’s 204 shortcut nor stream an unchanged
body echo; an independently negotiated outside-Preview 204 remains
available. Use Self::body for read-only inspection.
pub fn into_request(self) -> Result<Request, Error>
pub fn into_request(self) -> Result<Request, Error>
Turn a REQMOD service input into its streaming HTTP request.
pub fn into_response(self) -> Result<Response, Error>
pub fn into_response(self) -> Result<Response, Error>
Turn a RESPMOD service input into its streaming HTTP response.
pub fn into_parts(self) -> (IncomingRequestParts, Body)
pub fn into_parts(self) -> (IncomingRequestParts, Body)
Split the typed service request into named metadata and its body.
Trait Implementations§
§impl Debug for IncomingRequest
impl Debug for IncomingRequest
§impl ExtensionsRef for IncomingRequest
impl ExtensionsRef for IncomingRequest
§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
Extensions storeAuto Trait Implementations§
impl !Freeze for IncomingRequest
impl !RefUnwindSafe for IncomingRequest
impl !UnwindSafe for IncomingRequest
impl Send for IncomingRequest
impl Sync for IncomingRequest
impl Unpin for IncomingRequest
impl UnsafeUnpin for IncomingRequest
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