tower-rs / tower

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

feat: Make new functions const when possible #760

Closed kerkmann closed 4 months ago

kerkmann commented 10 months ago

The main reason was to allow to initialize the RateLimitLayer in a const context. So why not making ever new function const (wherever it's possible). :P

tobz commented 4 months ago

This is blocked on the MSRV, which would need to be at least 1.61 to support generic trait bounds on const functions.

Parking for now.

tobz commented 3 months ago

This has been released as part of tower@v0.5.0, tower-layer@v0.3.3, and tower-service@v0.3.3.

Thanks again for your contribution!