Commit Graph
13 Commits
Author SHA1 Message Date
David Pedersen ca8a6c08c2 axum-extra: Version 0.1.5
- **added:** Add `TypedPath::to_uri` for converting the path into a `Uri` ([#790])

[#790]: https://github.com/tokio-rs/axum/pull/790
2022-03-01 14:19:20 +01:00
David PedersenandMatthias Vogelgesang 84cbb66575 Backport TypedPath::to_uri (#809)
* axum-macros: use fully qualified Result type (#796)

* 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

* Remove out of date docs

These accidentally weren't removed in https://github.com/tokio-rs/axum/pull/790

Co-authored-by: Matthias Vogelgesang <[email protected]>
2022-03-01 14:17:17 +01:00
David Pedersen 36da5fceab axum-extra: Version 0.1.4 2022-02-22 15:05:53 +01:00
David Pedersen ed877820ce Fix dependency versions in axum-extra (#782)
Updating to axum-extra 0.1.3 might cause the build to fail if axum
wasn't also updated, since axum-extra 0.1.3 needs
`axum::middleware::from_fn`.

This fixes that by depending on the right patch versions for axum and
axum-macros.
2022-02-22 15:04:45 +01:00
David Pedersen aa4ab8b084 axum-extra: Version 0.1.3 2022-02-22 13:59:46 +01:00
David PedersenandJonas Platte c298c36577 Type safe routing (#756)
* wip

* wip

* make macro implement trait

* checkpoint

* checkpoint

* Simplify things quite a bit

* re-export `axum_macros::TypedPath` from `axum_extra`

* docs

* add missing feature

* fix docs link

* fix features

* fix missing imports

* make serde an optional dep again

* ui tests

* Break things up a bit

* Update span for `FromRequest` impls to point to callsite

* make docs feature labels show up automatically

* Apply suggestions from code review

Co-authored-by: Jonas Platte <[email protected]>

* add note about Display/Serialize being compatible

* Update axum-extra/src/routing/typed.rs

Co-authored-by: Jonas Platte <[email protected]>

* fix missing docs link

* what about typed methods?

* Revert "what about typed methods?"

This reverts commit cc1f989467.

* don't allow wildcards for now

* percent encode params

* Update axum-extra/src/routing/typed.rs

Co-authored-by: Jonas Platte <[email protected]>

* rephrase args

* changelog

Co-authored-by: Jonas Platte <[email protected]>
2022-02-22 13:33:10 +01:00
David Pedersen 6d821d2a23 Move middleware::from_fn into axum (#719)
* Move `middleware::from_fn` into axum

* changelog

* fix feature

* Rephrase changelog a bit
2022-02-22 13:33:10 +01:00
Guy Lapid d602682821 Add support for returning pretty JSON response in axum_extra::response::ErasedJson (#662) 2021-12-28 09:19:24 +00:00
David Pedersen de37a3e737 Tweak tower dependency in axum-extra (#666)
Fixes https://github.com/tokio-rs/axum/issues/659
2021-12-27 23:28:58 +01:00
David Pedersen 9f5f29dfba axum-extra: Version 0.1.1 (#658)
- Add `middleware::from_fn` for creating middleware from async functions ([#656])

[#656]: https://github.com/tokio-rs/axum/pull/656
2021-12-27 15:23:02 +01:00
David Pedersen f4716084a7 Add middleware::from_fn for creating middleware from async fns (#656)
* Add `middleware::from_fn` for creating middleware from async fns

* More trait impls for `Next`

* Make `Next::run` consume `self`

* Use `.router_layer` in example, since middleware returns early

* Actually `Next` probably shouldn't impl `Clone` and `Service`

Has implications for backpressure and stuff

* Simplify `print-request-response` example

* Address review feedback

* add changelog link
2021-12-27 14:01:26 +01:00
David Pedersen a63843d6c5 Release axum, axum-core, and axum-extra (#582) 2021-12-02 20:02:38 +01:00
David Pedersen a16ea65031 Add axum-extra crate (#536)
* Add `axum-extra` crate

Empty for now but now we have a place to put stuff.

I'll make a PR for moving over https://github.com/davidpdrsn/axum-resource.

* remove `authors` field from `Cargo.toml`s
2021-11-17 20:00:32 +00:00