pub struct RouteTable { /* private fields */ }Implementations§
Source§impl RouteTable
impl RouteTable
Sourcepub fn find(&self, path: &str) -> Option<usize>
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.
Sourcepub fn find_full(&self, path: &str) -> Option<(usize, Vec<(String, String)>)>
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.
Sourcepub fn find_candidates(&self, path: &str) -> Vec<(usize, Vec<(String, String)>)>
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.
Sourcepub fn rewrite_regex(&self, idx: usize) -> Option<&Regex>
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.
Sourcepub fn rewrite_substitution(&self, idx: usize) -> Option<&CompiledSubstitution>
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.
Sourcepub fn cors_origins(&self, idx: usize) -> Option<&CompiledCorsOrigins>
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).
Sourcepub fn compression_types(
&self,
idx: usize,
) -> Option<&CompiledContentTypeFilter>
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).
Sourcepub fn deprecation(&self, idx: usize) -> Option<&CompiledDeprecation>
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).
Sourcepub fn accept_media_type(&self, idx: usize) -> Option<&str>
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.
Sourcepub fn request_body_ops(&self, idx: usize) -> Option<&CompiledJsonTransform>
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).
Sourcepub fn response_body_ops(&self, idx: usize) -> Option<&CompiledJsonTransform>
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).
Sourcepub fn masking(&self, idx: usize) -> Option<&CompiledMasking>
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).
Sourcepub fn cache(&self, idx: usize) -> Option<&Arc<CompiledRouteCache>>
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).
Sourcepub fn mock_body(&self, idx: usize) -> Option<&Bytes>
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).
Sourcepub fn effective_security_headers(&self, idx: usize) -> Option<&SecurityHeaders>
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§
Auto Trait Implementations§
impl !Freeze for RouteTable
impl !RefUnwindSafe for RouteTable
impl Send for RouteTable
impl Sync for RouteTable
impl Unpin for RouteTable
impl UnwindSafe for RouteTable
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
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
§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