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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use Formatter;
/// The route template that matched for the incoming request.
///
/// # Example
///
/// If you configure your [`Blueprint`] like this:
///
/// ```rust
/// use pavex::{f, blueprint::{Blueprint, router::GET}};
/// # use pavex::{request::RequestHead, response::Response};
/// # fn get_home(request: RequestHead) -> Response { todo!() }
/// # fn main() {
/// # let mut bp = Blueprint::new();
///
/// bp.route(GET, "/home/:home_id", f!(crate::get_home));
/// # }
/// ```
///
/// Then [`MatchedPathPattern`] will be set to `/home/:home_id` for a `GET /home/123` request.
///
/// # Framework primitive
///
/// `MatchedPathPattern` is a framework primitive—you don't need to register any constructor
/// with [`Blueprint`] to use it in your application.
///
/// # Use cases
///
/// The primary use case for [`MatchedPathPattern`] is telemetry—logging, metrics, etc.
/// It lets you strip away the dynamic parts of the request path, thus reducing the cardinality of
/// your metrics and making it easier to aggregate them.
///
/// [`Blueprint`]: crate::blueprint::Blueprint
;