Skip to content

when I add tower::limit::RateLimitLayer in the route_layer, it shows the trait bound tower::limit::RateLimit<Route<_>>: Clone is not satisfied the trait Clone is not implemented for tower::limit::RateLimit<Route<_>>. #877

Answered by davidpdrsn
goldwind-ting asked this question in Q&A
Discussion options

You must be logged in to vote

Well the compile error has all the info. Services used with axum must be Clone which RateLimit isn't. I'm not familiar with how RateLimit so can't say why that is. You can combine it with BufferLayer to make it Clone.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by davidpdrsn
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 #876 on March 20, 2022 10:15.