RouteTable

Struct RouteTable 

Source
pub struct RouteTable { /* private fields */ }

Implementations§

Source§

impl RouteTable

Source

pub fn find(&self, path: &str) -> Option<usize>

Resolve a request path to a route index. Precedence: exact template, then most-specific regex match, then longest prefix. None means no route.

Source

pub fn find_full(&self, path: &str) -> Option<(usize, Vec<(String, String)>)>

Like RouteTable::find but also returns the path parameters captured by an exact-template match ({name} segments), as (name, value) pairs in template order. Regex- and prefix-kind routes return an empty parameter list.

Source

pub fn find_candidates(&self, path: &str) -> Vec<(usize, Vec<(String, String)>)>

Yield all candidate route indices for a path in precedence order (DP-06, #254): exact, then regex matches by specificity (highest first), then prefix matches by longest prefix. Each candidate also carries its path parameters (populated only for exact matches). The caller is expected to test non-path criteria (route_applies) on each candidate and stop at the first that fully matches – this is the “fall-through” behavior.

Source

pub fn rewrite_regex(&self, idx: usize) -> Option<&Regex>

The compiled rewrite regex for idx, if the route’s proxy action carries a path_rewrite.regex.

Source

pub fn rewrite_substitution(&self, idx: usize) -> Option<&CompiledSubstitution>

The precompiled substitution template for idx (PERF-04, #206), if the route’s proxy action carries a path_rewrite.regex.

Source

pub fn cors_origins(&self, idx: usize) -> Option<&CompiledCorsOrigins>

The precompiled CORS origin matcher for route idx (None: the route carries no cors block — exactly mirroring gateway().routes[idx].cors).

Source

pub fn compression_types( &self, idx: usize, ) -> Option<&CompiledContentTypeFilter>

The precompiled compression content-type filter for route idx (None: the route carries no compression block — exactly mirroring gateway().routes[idx].compression).

Source

pub fn deprecation(&self, idx: usize) -> Option<&CompiledDeprecation>

The precompiled deprecation header values for route idx (None: the route carries no deprecation block — exactly mirroring gateway().routes[idx].deprecation).

Source

pub fn accept_media_type(&self, idx: usize) -> Option<&str>

The normalized match.accept media type for route idx (None: the route carries no accept criterion — exactly mirroring gateway().routes[idx].r#match.accept). This is the comparison key the proxy’s Accept criterion must use, never the raw config string.

Source

pub fn request_body_ops(&self, idx: usize) -> Option<&CompiledJsonTransform>

The precompiled REQUEST JSON body transform for route idx (None: the route transforms no request bodies — exactly mirroring gateway().routes[idx].transforms.request.body).

Source

pub fn response_body_ops(&self, idx: usize) -> Option<&CompiledJsonTransform>

The precompiled RESPONSE JSON body transform for route idx (None: the route transforms no response bodies — exactly mirroring gateway().routes[idx].transforms.response.body).

Source

pub fn masking(&self, idx: usize) -> Option<&CompiledMasking>

The precompiled response field masking policy for route idx (None: the route masks nothing — exactly mirroring gateway().routes[idx].masking).

Source

pub fn cache(&self, idx: usize) -> Option<&Arc<CompiledRouteCache>>

The precompiled response-cache policy for route idx (None: the route’s responses are never cached — exactly mirroring gateway().routes[idx].cache, with the policy-derived vary folds already resolved).

Source

pub fn mock_body(&self, idx: usize) -> Option<&Bytes>

The preloaded mock response body for route idx (DW-047, None: the route carries no mock body_file — exactly mirroring gateway().routes[idx].action.mock.body_file).

Source

pub fn effective_security_headers(&self, idx: usize) -> Option<&SecurityHeaders>

The effective security headers for a route (SEC-09, #213): the route’s own security_headers block when present, else the gateway-level default_security_headers when the route has not opted out, else None.

Trait Implementations§

Source§

impl Debug for RouteTable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AnyExt for T
where T: Any + ?Sized,

§

fn downcast_ref<T>(this: &Self) -> Option<&T>
where T: Any,

Attempts to downcast this to T behind reference
§

fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>
where T: Any,

Attempts to downcast this to T behind mutable reference
§

fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>
where T: Any,

Attempts to downcast this to T behind Rc pointer
§

fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>
where T: Any,

Attempts to downcast this to T behind Arc pointer
§

fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>
where T: Any,

Attempts to downcast this to T behind Box pointer
§

fn downcast_move<T>(this: Self) -> Option<T>
where T: Any, Self: Sized,

Attempts to downcast owned Self to T, useful only in generic context as a workaround for specialization
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, X> CoerceTo<T> for X
where T: CoerceFrom<X> + ?Sized,

§

fn coerce_rc_to(self: Rc<X>) -> Rc<T>

§

fn coerce_box_to(self: Box<X>) -> Box<T>

§

fn coerce_ref_to(&self) -> &T

§

fn coerce_mut_to(&mut self) -> &mut T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ServiceExt for T

§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,