Expand description
Trie-based HTTP router.
This crate provides a high-performance radix trie router optimized for the fastapi_rust framework.
§Features
- Radix trie for fast lookups
- Path parameter extraction (
/items/{id}) - Type-safe path converters
- Static route optimization
§Role In The System
fastapi-router is responsible for matching incoming paths to handlers and
extracting typed parameters. fastapi-core uses it for request dispatch,
while fastapi-openapi reads its parameter metadata when generating specs.
Keeping the router isolated allows the rest of the framework to stay focused
on request semantics rather than path matching internals.
Structs§
- Allowed
Methods - Allowed methods for a matched path.
- Invalid
Route Error - Error returned when a route path is invalid.
- Param
Info - Path parameter information with optional OpenAPI metadata.
- Route
- A route definition with handler for request processing.
- Route
Conflict Error - Error returned when a new route conflicts with an existing one.
- Route
Match - A matched route with extracted parameters.
- Route
Registration - A route registration entry placed in a linker section.
- Route
Response - Response declaration for OpenAPI documentation.
- Route
Security Requirement - Security requirement for a route.
- Router
- Radix trie router.
Enums§
- Conversion
Error - Error type for parameter conversion failures.
- Converter
- Path parameter type converter.
- Param
Value - A type-converted path parameter value.
- Route
AddError - Error returned when adding a route fails.
- Route
Lookup - Result of attempting to locate a route by path and method.
Functions§
- extract_
path_ params - Extract path parameters from a route path pattern.
- registered_
routes - Return all routes registered via the link-section table.