tower-rs / tower

async fn(Request) -> Result<Response, Error>
https://docs.rs/tower
MIT License
3.56k stars 281 forks source link

impl `Clone` for `RateLimit <T>` #794

Open lcmgh opened 2 months ago

lcmgh commented 2 months ago

ConcurrencyLimit <T> implements Clone here: https://docs.rs/tower/latest/src/tower/limit/concurrency/service.rs.html#96

RateLimit<T> does not https://docs.rs/tower/latest/src/tower/limit/rate/service.rs.html#14

Consequence: I am adding service specific layers by wrapping them into a new Service that auto-implements NamedService but as add_service requires clone the layer must also support it.