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 respond_no_modification(
self,
service_tag: impl AsRef<[u8]>,
) -> Result<OutgoingResponse, Error>
pub fn respond_no_modification( self, service_tag: impl AsRef<[u8]>, ) -> Result<OutgoingResponse, Error>
Return a 204 response and leave the HTTP message unchanged.
service_tag may be supplied as text or bytes.
§Contract
Do not return 204 after Preview has continued unless the request
contains Allow: 204.
pub fn respond_method_not_allowed(
self,
service_tag: impl AsRef<[u8]>,
) -> Result<OutgoingResponse, Error>
pub fn respond_method_not_allowed( self, service_tag: impl AsRef<[u8]>, ) -> Result<OutgoingResponse, Error>
Return a 405 response for this ICAP request method.
service_tag may be supplied as text or bytes.
pub async fn adapt_response_head(
self,
service_tag: impl AsRef<[u8]>,
) -> Result<OutgoingResponse, Error>
pub async fn adapt_response_head( self, service_tag: impl AsRef<[u8]>, ) -> Result<OutgoingResponse, Error>
Return the current RESPMOD response head and preserve its body.
service_tag may be supplied as text or bytes.
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 const fn encapsulated_mut(&mut self) -> Option<&mut Encapsulated>
pub const fn encapsulated_mut(&mut self) -> Option<&mut Encapsulated>
Return the mutable typed HTTP metadata, when present.
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