use super::route::Route;
/// A `Descriptor` is a struct returned from `Fragment::describe` that contains the root path and routes.
pub struct Descriptor {
pub root: &'static str,
pub routes: Vec<(&'static str, Route)>,
pub root_fn: Option<Route>
}
impl Descriptor {
/// This function creates a new `Descriptor` from a root path and routes.
pub fn new(root: &'static str, routes: Box<[(&'static str, Route)]>, root_fn: Option<Route>) -> Self {
Descriptor {
root,
routes: routes.into_vec(),
root_fn
}
}
}