1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! URLs into the request's panel, so app code never spells a prefix.
//!
//! Each helper answers for the panel serving the request: the one whose
//! prefix the request is under, or the only panel when the router mounts one.
//! A resource or page that panel does not register has no URL there, and the
//! helper returns `None`.
//!
//! ```text
//! let posts = tablo::url::resource::<PostResource>(cx); // Some("/admin/posts")
//! let media = tablo::url::page::<MediaLibraryPage>(cx); // Some("/admin/media")
//! let home = tablo::url::panel(cx); // Some("/admin")
//! ```
use TypeId;
use Cx;
use current;
use crate::;
/// The request's panel prefix, e.g. `/admin`.
/// `R`'s list URL in the request's panel, e.g. `/admin/posts`.
/// `P`'s URL in the request's panel: `{prefix}/{slug}`, or the prefix itself
/// for the panel's [`home`](super::Panel::home) page.