Skip to content

Can you move an App into an HttpServer::new? #3417

Answered by robjtede
alshdavid asked this question in Q&A
Discussion options

You must be logged in to vote

The closure passed to HttpServer::new is an app factory and App doesn't impl Clone so it's not possible to just clone the app into the re-usable closure.

You can however return an app from a function or use App::configure() to split up or share routing setups.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by robjtede
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