Rocket/lib/src/codegen.rs
Sergio Benitez 4df7ce6bf5 Propogate route names through codegen to runtime.
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.
2017-08-20 10:55:23 -07:00

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,
}