mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-08 00:00:24 +02:00
Remove buffer from BoxRoute (#270)
Boxing a service normally means using `tower::util::BoxService`. That doesn't implement `Clone` however so normally I had been combining it with `Buffer` to get that. But recently I discovered https://github.com/dtolnay/dyn-clone which makes it possible to clone trait objects. So this adds a new internal utility called `CloneBoxService` which replaces the previous `BoxService` + `Buffer` combo in `BoxRoute`. I'll investigate upstreaming that to tower. I think it makes sense there since box + clone is quite a common need.
This commit is contained in:
@@ -41,6 +41,8 @@ tower-layer = "0.3"
|
||||
tower-http = { version = "0.1", features = ["add-extension", "map-response-body"] }
|
||||
sync_wrapper = "0.1.1"
|
||||
|
||||
dyn-clone = "1.0"
|
||||
|
||||
# optional dependencies
|
||||
tokio-tungstenite = { optional = true, version = "0.15" }
|
||||
sha-1 = { optional = true, version = "0.9.6" }
|
||||
|
||||
Reference in New Issue
Block a user