pub struct RoutingTable { /* private fields */ }Expand description
The parsed routing table (Java RoutingEntry).
Implementations§
Source§impl RoutingTable
impl RoutingTable
Sourcepub fn load(reader: &ConfigReader) -> Result<Self, AppError>
pub fn load(reader: &ConfigReader) -> Result<Self, AppError>
Load and validate a rest.yaml (Java RoutingEntry.load). Invalid
entries fail the load — the grammar’s parser invariants.
Sourcepub fn static_content(&self) -> &StaticContent
pub fn static_content(&self) -> &StaticContent
The static-content configuration (defaults applied when absent).
Sourcepub fn from_yaml_text(yaml: &str) -> Result<Self, AppError>
pub fn from_yaml_text(yaml: &str) -> Result<Self, AppError>
Build a routing table from YAML text (used for the built-in default endpoints — same parser, same invariants).
pub fn routes(&self) -> &[RouteInfo]
Sourcepub fn has_url(&self, url: &str) -> bool
pub fn has_url(&self, url: &str) -> bool
Whether any entry already claims this URL (used by the default-endpoint
merge: user entries always win — Java default-rest.yaml semantics).
Sourcepub fn find(&self, method: &str, path: &str) -> Option<AssignedRoute<'_>>
pub fn find(&self, method: &str, path: &str) -> Option<AssignedRoute<'_>>
Match a request (Java getRouteInfo): candidates must match every
segment; precedence is more literal segments first, wildcard last.
Method filtering happens here too — OPTIONS matches any entry (CORS
preflight, auto-added per the grammar).
Sourcepub fn path_matches_any_method(&self, path: &str) -> bool
pub fn path_matches_any_method(&self, path: &str) -> bool
True when the path matches SOME entry regardless of method — the Java
getSimilarRoute marker (increment 56, parity F14c): a known path
with a wrong method answers 405 “Method not allowed”, never 404.