Commit Graph
11 Commits
Author SHA1 Message Date
David Pedersen 46f85fd9ba docs 2022-02-13 22:08:49 +01:00
David Pedersen 1b7326e9de re-export axum_macros::TypedPath from axum_extra 2022-02-13 21:31:56 +01:00
David Pedersen 9f5dbfd83a Simplify things quite a bit 2022-02-13 21:10:56 +01:00
David Pedersen 4f087190a5 checkpoint 2022-02-13 14:41:49 +01:00
David Pedersen 47f5954903 checkpoint 2022-02-13 13:29:01 +01:00
David Pedersen c84d6d66d4 make macro implement trait 2022-02-13 12:49:12 +01:00
David Pedersen 3682586513 wip 2022-02-11 10:40:25 +01:00
David Pedersen b42ccc8eda wip 2022-02-10 16:46:42 +01:00
David PedersenandJonas Platte 911c4a788e Support opt-out of extra derived traits for rejections for #[derive(FromRequest)] (#729)
* Handle structs without fields

* Support opt-out of derived rejection traits

* Handle duplicate opt outs

* Improve error if opting out of `Display` or `Debug` but not `Error`

* document `rejection_derive`

* Handle using both `via` and `rejection_derive`

* don't derive debug for `RejectionDeriveOptOuts`

* Update axum-macros/src/from_request.rs

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

Co-authored-by: Jonas Platte <[email protected]>
2022-01-28 09:54:38 +00:00
David PedersenandJonas Platte f6fc5ed80c Move axum-debug into axum-macros (#724)
* Move axum-debug into axum-macros

* fix ref to axum-macros in changelog

* Apply suggestions from code review

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

Co-authored-by: Jonas Platte <[email protected]>
2022-01-26 23:27:22 +01:00
David PedersenandJonas Platte e4c389c94d Add axum-macros crate with #[derive(FromRequest)] (#718)
* initial working impl

* support `#[from_request(via(...))]`

* support extracting the whole thing at once

* rely on type inference

* fix footgun

* fix typo

* generate rejection enums

* move tests to trybuild

* minor clean up

* docs

* Support multiple generic extractors with same "via" type

* support `Result` as well

* Update axum-macros/src/from_request.rs

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

* Add `#[automatically_derived]`

* remove needless `#[derive(Debug)]` on macro types

* Fix error messages that different for some reason

* Update axum-macros/src/lib.rs

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

* add more `#[automatically_derived]`

* support same types in tuple structs

* update docs

* prep axum-macros for release

* address review feedback

* Update axum-macros/src/lib.rs

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

* Update axum-macros/src/lib.rs

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

* Update known limitation

Co-authored-by: Jonas Platte <[email protected]>
2022-01-25 15:05:50 +01:00