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 ; 20 21use crate; 22use Router; 23use ; 24use header; 25use Parts; 26use IntoResponse; 27use ; 28use Serialize; 29 30/// A breadcrumb segment for the navigation bar. 31 32 36 37/// Builds breadcrumbs for a tree path. 38/// 39/// The root breadcrumb is always `"tree"`. Each path segment adds a breadcrumb 40/// linking to its corresponding subdirectory. 41 62 63/// Axum extractor that pulls the `{repo}` path parameter and validates it 64/// contains no path traversal components before passing it to handlers. 65; 66 67 92 93/// Shared application state passed to all route handlers. 94 95 101 102/// Serves the concatenated stylesheet. 103async 109 110/// Catch-all for undefined sub-paths under `/{repo}/`. 111/// Returns a styled 404 via the error handler instead of axum's bare 404. 112async 117 118/// Serves the favicon bytes loaded at startup, with the correct MIME type. 119async 125 126/// Builds the application router with all routes and shared state attached. 127