mirror of
https://github.com/rwf2/Rocket.git
synced 2025-01-08 10:42:37 +00:00
4df7ce6bf5
This commit modifies `codegen` so that a route's name (the name of the route handler) is stored in the generated static route information structure and later propogated into the corresponding `Route` structure. The primary advantage of this change is an improvement to debug and error messages which now include route names. The collision error message, in particular, has been improved dramatically in this commit. Additionally, the `LaunchError::Collision` variant now contains a vector of the colliding routes.
17 lines
353 B
Rust
17 lines
353 B
Rust
use handler::{Handler, ErrorHandler};
|
|
use http::{Method, MediaType};
|
|
|
|
pub struct StaticRouteInfo {
|
|
pub name: &'static str,
|
|
pub method: Method,
|
|
pub path: &'static str,
|
|
pub format: Option<MediaType>,
|
|
pub handler: Handler,
|
|
pub rank: Option<isize>,
|
|
}
|
|
|
|
pub struct StaticCatchInfo {
|
|
pub code: u16,
|
|
pub handler: ErrorHandler,
|
|
}
|