Skip to content

Conversation

@mccormickt
Copy link
Contributor

@mccormickt mccormickt commented Jan 26, 2026

This PR derives FromRef::from_ref on AppContext to allow extractors to pull out fields of AppContext as substates in handers. It also refactors our existing extractors to be able to work with any state that implements FromRef to pull out the required substate (e.g. DatabaseConnection, Config, SharedStore, Cache, etc.).

This allows extractors to pull out fields of `AppContext` as [substates](https://docs.rs/axum/0.8.8/axum/extract/struct.State.html\#substates) in handlers through [`FromRef::from_ref`](https://docs.rs/axum/latest/axum/extract/trait.FromRef.html)
@mccormickt mccormickt changed the title chore: Derive FromRef on AppContext refactor: Decouple extractors from AppContext using FromRef Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant