Skip to content

Commit 43323cc

Browse files
pietroalbiniJoshua Nelson
authored and
Joshua Nelson
committed
web: add more comments to Routes
1 parent 2678506 commit 43323cc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/web/routes.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,17 @@ pub(super) fn build_routes() -> Routes {
125125
routes
126126
}
127127

128+
/// This wrapper class aids the construction of iron's Router, with docs.rs-specific additions to
129+
/// it. Routes are supposed to be added by the build_routes function, which calls methods in this
130+
/// struct depending on the type of route being added.
128131
pub(super) struct Routes {
132+
/// Normal GET routes.
129133
get: Vec<(String, Box<dyn Handler>)>,
134+
/// GET routes serving rustdoc content. The BlockBlacklistedPrefixes middleware is added
135+
/// automatically to all of them.
130136
rustdoc_get: Vec<(String, Box<dyn Handler>)>,
137+
/// Prefixes of all the internal routes. This data is used to power the
138+
/// BlockBlacklistedPrefixes middleware.
131139
page_prefixes: HashSet<String>,
132140
}
133141

0 commit comments

Comments
 (0)