Struct AdaptationLayer
pub struct AdaptationLayer<C, D = NoOptionsDiscovery> { /* private fields */ }http and icap only.Expand description
Rama layer that detours HTTP requests and responses through ICAP.
Implementations§
§impl<C> AdaptationLayer<C>
impl<C> AdaptationLayer<C>
pub fn new(client: C) -> AdaptationLayer<C>
pub fn new(client: C) -> AdaptationLayer<C>
Create a layer using client to establish ICAP connections.
§impl<C, D> AdaptationLayer<C, D>
impl<C, D> AdaptationLayer<C, D>
pub fn with_options_service<D2>(self, options: D2) -> AdaptationLayer<C, D2>
pub fn with_options_service<D2>(self, options: D2) -> AdaptationLayer<C, D2>
Enable automatic OPTIONS discovery through options.
Compose an OptionsCacheLayer
around an always-fetching service to avoid discovery per request. A
provider may return either an owned capability snapshot or an Arc.
pub fn options_service(&self) -> Option<&D>
pub fn options_service(&self) -> Option<&D>
Return the optional OPTIONS discovery service.
pub fn maybe_with_request_service(
self,
service: Option<ServiceEndpoint>,
) -> AdaptationLayer<C, D>
pub fn maybe_with_request_service( self, service: Option<ServiceEndpoint>, ) -> AdaptationLayer<C, D>
Set the optional REQMOD service.
pub fn maybe_set_request_service(
&mut self,
service: Option<ServiceEndpoint>,
) -> &mut AdaptationLayer<C, D>
pub fn maybe_set_request_service( &mut self, service: Option<ServiceEndpoint>, ) -> &mut AdaptationLayer<C, D>
Set the optional REQMOD service.
pub fn with_request_service(
self,
service: ServiceEndpoint,
) -> AdaptationLayer<C, D>
pub fn with_request_service( self, service: ServiceEndpoint, ) -> AdaptationLayer<C, D>
Set the optional REQMOD service.
pub fn set_request_service(
&mut self,
service: ServiceEndpoint,
) -> &mut AdaptationLayer<C, D>
pub fn set_request_service( &mut self, service: ServiceEndpoint, ) -> &mut AdaptationLayer<C, D>
Set the optional REQMOD service.
pub fn without_request_service(self) -> AdaptationLayer<C, D>
pub fn without_request_service(self) -> AdaptationLayer<C, D>
Set the optional REQMOD service.
pub fn unset_request_service(&mut self) -> &mut AdaptationLayer<C, D>
pub fn unset_request_service(&mut self) -> &mut AdaptationLayer<C, D>
Set the optional REQMOD service.
pub const fn request_service(&self) -> Option<&ServiceEndpoint>
pub const fn request_service(&self) -> Option<&ServiceEndpoint>
Return the optional REQMOD service.
pub fn maybe_with_response_service(
self,
service: Option<ServiceEndpoint>,
) -> AdaptationLayer<C, D>
pub fn maybe_with_response_service( self, service: Option<ServiceEndpoint>, ) -> AdaptationLayer<C, D>
Set the optional RESPMOD service.
This adapts origin responses. Responses returned directly by a REQMOD service are considered final and bypass RESPMOD.
pub fn maybe_set_response_service(
&mut self,
service: Option<ServiceEndpoint>,
) -> &mut AdaptationLayer<C, D>
pub fn maybe_set_response_service( &mut self, service: Option<ServiceEndpoint>, ) -> &mut AdaptationLayer<C, D>
Set the optional RESPMOD service.
This adapts origin responses. Responses returned directly by a REQMOD service are considered final and bypass RESPMOD.
pub fn with_response_service(
self,
service: ServiceEndpoint,
) -> AdaptationLayer<C, D>
pub fn with_response_service( self, service: ServiceEndpoint, ) -> AdaptationLayer<C, D>
Set the optional RESPMOD service.
This adapts origin responses. Responses returned directly by a REQMOD service are considered final and bypass RESPMOD.
pub fn set_response_service(
&mut self,
service: ServiceEndpoint,
) -> &mut AdaptationLayer<C, D>
pub fn set_response_service( &mut self, service: ServiceEndpoint, ) -> &mut AdaptationLayer<C, D>
Set the optional RESPMOD service.
This adapts origin responses. Responses returned directly by a REQMOD service are considered final and bypass RESPMOD.
pub fn without_response_service(self) -> AdaptationLayer<C, D>
pub fn without_response_service(self) -> AdaptationLayer<C, D>
Set the optional RESPMOD service.
This adapts origin responses. Responses returned directly by a REQMOD service are considered final and bypass RESPMOD.
pub fn unset_response_service(&mut self) -> &mut AdaptationLayer<C, D>
pub fn unset_response_service(&mut self) -> &mut AdaptationLayer<C, D>
Set the optional RESPMOD service.
This adapts origin responses. Responses returned directly by a REQMOD service are considered final and bypass RESPMOD.
pub const fn response_service(&self) -> Option<&ServiceEndpoint>
pub const fn response_service(&self) -> Option<&ServiceEndpoint>
Return the optional RESPMOD service.
Trait Implementations§
§impl<C, D> Clone for AdaptationLayer<C, D>
impl<C, D> Clone for AdaptationLayer<C, D>
§fn clone(&self) -> AdaptationLayer<C, D>
fn clone(&self) -> AdaptationLayer<C, D>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<C, D> Debug for AdaptationLayer<C, D>
impl<C, D> Debug for AdaptationLayer<C, D>
§impl<C, D, S> Layer<S> for AdaptationLayer<C, D>
impl<C, D, S> Layer<S> for AdaptationLayer<C, D>
§type Service = Adaptation<S, C, D>
type Service = Adaptation<S, C, D>
§fn layer(&self, inner: S) -> <AdaptationLayer<C, D> as Layer<S>>::Service
fn layer(&self, inner: S) -> <AdaptationLayer<C, D> as Layer<S>>::Service
§fn into_layer(self, inner: S) -> <AdaptationLayer<C, D> as Layer<S>>::Service
fn into_layer(self, inner: S) -> <AdaptationLayer<C, D> as Layer<S>>::Service
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl<C, D = NoOptionsDiscovery> !Freeze for AdaptationLayer<C, D>
impl<C, D> RefUnwindSafe for AdaptationLayer<C, D>
impl<C, D> Send for AdaptationLayer<C, D>
impl<C, D> Sync for AdaptationLayer<C, D>
impl<C, D> Unpin for AdaptationLayer<C, D>
impl<C, D> UnsafeUnpin for AdaptationLayer<C, D>
impl<C, D> UnwindSafe for AdaptationLayer<C, D>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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