We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib.rs
struct BtnifyState<S> { buttons_map: HashMap<String, Box<dyn (Fn(&S) -> ButtonResponse) + Send + Sync>>, user_state: S, page: Html<String> } /* ... */ async fn get_root<S: Send + Sync>(State(state): State<Arc<BtnifyState<S>>>) -> Html<String> { // TODO: DONT USE CLONE state.page.clone() }
Clone is efficient.
The text was updated successfully, but these errors were encountered:
Page can't be moved out of state and a reference to page is also difficult because state is an Arc. Perhaps using a different state method in Axum? https://docs.rs/axum/latest/axum/extract/struct.State.html
Sorry, something went wrong.
No branches or pull requests
lib.rs
Clone is efficient.
The text was updated successfully, but these errors were encountered: