Parent
[>]
1//! Route handlers, shared types, and router construction. 2//! 3//! This module defines the [`AppState`] injected into every handler, the 4//! [`RepoName`] path extractor (which validates against directory traversal), 5//! the [`Breadcrumb`] type used by tree/blame pages, and the [`router`] 6//! function that wires all 15 routes together. 7 8 9 10 11 12 13 14 15 16 17 18use HashMap; 19use ; 20use Arc; 21 22use crateSiteConfig; 23use crate; 24use Router; 25use ; 26use header; 27use Parts; 28use IntoResponse; 29use ; 30use Serialize; 31 32/// A breadcrumb segment for the navigation bar. 33 34 38 39/// Builds breadcrumbs for a tree path. 40/// 41/// The root breadcrumb is always `"tree"`. Each path segment adds a breadcrumb 42/// linking to its corresponding subdirectory. 43 64 65/// Axum extractor that pulls the `{repo}` path parameter and validates it 66/// contains no path traversal components before passing it to handlers. 67; 68 69 94 95/// Shared application state passed to all route handlers. 96 97 105 106/// Serves the concatenated stylesheet. 107async 113 114/// Catch-all for undefined sub-paths under `/{repo}/`. 115/// Returns a styled 404 via the error handler instead of axum's bare 404. 116async 121 122/// Serves the favicon bytes loaded at startup, with the correct MIME type. 123async 129 130/// Builds the application router with all routes and shared state attached. 131 153 154 155