Easily convert typed paths into URIs (#790)

* Easily convert typed paths into URIs

`#[derive(TypedPath)]` will now also generate `TryFrom<_> for Uri` for
easily converting paths into URIs for use with `Redirect` and friends.

Fixes https://github.com/tokio-rs/axum/issues/789

* Use a method on the `TypedPath` trait to convert to `Uri`

* fix doc ref

* Update changelogs
This commit is contained in:
David Pedersen
2022-02-28 09:58:22 +01:00
committed by GitHub
parent 67c385cd2d
commit da74084146
5 changed files with 45 additions and 2 deletions
+2
View File
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning].
# Unreleased
- **added:** Add `TypedPath::to_uri` for converting the path into a `Uri` ([#790])
- **added:** Add type safe routing. See `axum_extra::routing::typed` for more details ([#756])
- **breaking:** `CachedRejection` has been removed ([#699])
- **breaking:** `<Cached<T> as FromRequest>::Rejection` is now `T::Rejection`. ([#699])
@@ -16,6 +17,7 @@ and this project adheres to [Semantic Versioning].
[#699]: https://github.com/tokio-rs/axum/pull/699
[#719]: https://github.com/tokio-rs/axum/pull/719
[#756]: https://github.com/tokio-rs/axum/pull/756
[#790]: https://github.com/tokio-rs/axum/pull/790
# 0.1.2 (13. January, 2022)