Struct ProxyRoutesLayer
#[non_exhaustive]pub struct ProxyRoutesLayer { /* private fields */ }net only.Expand description
Resolve and materialize the route decision for downstream middleware.
Place every route-selection layer before this one, then place middleware
that consumes ProxyRoute after it. This is the sole middleware boundary
that needs to understand both route forms. The most recently inserted input
decision wins. An optional configured plan supplies defaults unless
Self::with_overwrite makes it authoritative. The selected plan publishes
its first route (or direct for an empty plan) to middleware and remains
authoritative for ProxyRoutesConnector, which still owns fallback
attempts.
Credentials and route-specific extensions are omitted from the middleware view of a multi-route plan. One HTTP header cannot safely authenticate every fallback and could leak to a later direct route, while publishing the first route’s extensions would contaminate later attempts. The connector retains the original per-route state and applies it to isolated attempts.
Implementations§
§impl ProxyRoutesLayer
impl ProxyRoutesLayer
pub const fn new() -> ProxyRoutesLayer
pub const fn new() -> ProxyRoutesLayer
Create a route materialization layer without configured defaults.
pub fn with_routes(routes: impl Into<ProxyRoutes>) -> ProxyRoutesLayer
pub fn with_routes(routes: impl Into<ProxyRoutes>) -> ProxyRoutesLayer
Create a route materialization layer with an ordered default plan.
An input ProxyRoute or ProxyRoutes decision takes precedence by
default. Use Self::with_overwrite when this plan is authoritative.
pub const fn with_overwrite(self, overwrite: bool) -> ProxyRoutesLayer
pub const fn with_overwrite(self, overwrite: bool) -> ProxyRoutesLayer
Let the configured route plan take precedence over an input route decision.
Trait Implementations§
§impl Clone for ProxyRoutesLayer
impl Clone for ProxyRoutesLayer
§fn clone(&self) -> ProxyRoutesLayer
fn clone(&self) -> ProxyRoutesLayer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ProxyRoutesLayer
impl Debug for ProxyRoutesLayer
§impl Default for ProxyRoutesLayer
impl Default for ProxyRoutesLayer
§fn default() -> ProxyRoutesLayer
fn default() -> ProxyRoutesLayer
§impl<S> Layer<S> for ProxyRoutesLayer
impl<S> Layer<S> for ProxyRoutesLayer
§type Service = ProxyRoutesService<S>
type Service = ProxyRoutesService<S>
§fn layer(&self, inner: S) -> <ProxyRoutesLayer as Layer<S>>::Service
fn layer(&self, inner: S) -> <ProxyRoutesLayer as Layer<S>>::Service
§fn into_layer(self, inner: S) -> <ProxyRoutesLayer as Layer<S>>::Service
fn into_layer(self, inner: S) -> <ProxyRoutesLayer as Layer<S>>::Service
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl Freeze for ProxyRoutesLayer
impl RefUnwindSafe for ProxyRoutesLayer
impl Send for ProxyRoutesLayer
impl Sync for ProxyRoutesLayer
impl Unpin for ProxyRoutesLayer
impl UnsafeUnpin for ProxyRoutesLayer
impl UnwindSafe for ProxyRoutesLayer
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