Skip to content

AppState::from_ref(...) inside a impl<S> FromRequest<S> breaks trait bounds axum::serve #2722

Answered by jplatte
samuela asked this question in Q&A
Discussion options

You must be logged in to vote

Extensions and state are two entirely separate mechanisms. To make AppState available as state, use .with_state(AppState {}), not .layer(Extension(...)). For some examples, see Sharing state with handlers.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@samuela
Comment options

Answer selected by samuela
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2721 on April 24, 2024 17:01.