docs: consolidate state management docs in crate root (#3683)

Co-authored-by: Yann Simon <[email protected]>
This commit is contained in:
kaze
2026-03-24 10:13:40 +01:00
committed by GitHub
co-authored by Yann Simon
parent a3446d68bc
commit 7c7a03927a
4 changed files with 61 additions and 1 deletions
+2 -1
View File
@@ -1,13 +1,14 @@
/// Used to do reference-to-value conversions thus not consuming the input value.
///
/// This is mainly used with [`State`] to extract "substates" from a reference to main application
/// state.
/// state. See ["Sharing state with handlers"][sharing-state] for a worked example.
///
/// See [`State`] for more details on how library authors should use this trait.
///
/// This trait can be derived using `#[derive(FromRef)]`.
///
/// [`State`]: https://docs.rs/axum/0.8/axum/extract/struct.State.html
/// [sharing-state]: https://docs.rs/axum/0.8/axum/index.html#sharing-state-with-handlers
// NOTE: This trait is defined in axum-core, even though it is mainly used with `State` which is
// defined in axum. That allows crate authors to use it when implementing extractors.
pub trait FromRef<T> {