Commit graph

27 commits

Author SHA1 Message Date
David Pedersen
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 <jplatte@users.noreply.github.com>

Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
2022-01-26 23:27:22 +01:00
David Pedersen
f96111851d Remove mention of IntoResponseHeaders from axum-debug 2022-01-23 20:25:12 +01:00
David Pedersen
d4849820ce Move Headers into axum 2022-01-23 20:25:12 +01:00
Jonas Platte
bf83f34617 Add trait IntoResponseHeaders (#649)
* Introduce IntoResponseHeaders trait

* Implement IntoResponseHeaders for HeaderMap

* Add impl IntoResponse for impl IntoResponseHeaders

… and update IntoResponse impls that use HeaderMap to be generic instead.

* Add impl IntoResponseHeaders for Headers

… and remove IntoResponse impls that use it.

* axum-debug: Fix grammar in docs

* Explain confusing error message in docs
2022-01-23 18:01:52 +01:00
David Pedersen
5ffab810c0
Update to changed compiler error in 1.58 (#708)
The trybuild tests needed to be updated for 1.58. We only run the tests
on stable (but build on other toolchains).
2022-01-14 09:32:34 +01:00
David Pedersen
3a259dcec7
axum-debug: Version 0.3.2 (#598)
- Support checking `FromRequest` bounds for extractors whose request body is something else than
  `axum::body::Body`. Use `#[debug_handler(body = YourBodyType)]` to use a different request body
  type ([#595])

[#595]: https://github.com/tokio-rs/axum/pull/595
2021-12-09 10:52:31 +01:00
David Pedersen
8895926f73
Support customizing the request body type in #[debug_handler] (#595) 2021-12-08 19:37:18 +01:00
David Pedersen
8e1341d1f6
Release axum, axum-core, and axum-debug (#591) 2021-12-06 10:30:09 +01:00
Kai Jewson
dfb06e721c
Introduce Response type alias as a shorthand for Response<BoxBody> (#590)
* Introduce `Response` type alias as a shorthand

* Don't re-export `Response` at the crate root
2021-12-05 19:16:46 +01:00
David Pedersen
cbb34869d8
Fix debug_handler for Result<impl IntoResponse, Error> and friends (#588)
Fixes #587
2021-12-04 18:24:58 +01:00
David Pedersen
628921bcad
axum-debug 0.3 (#586)
Forgot to ship this one so the latest version would generate wrong code.
2021-12-03 22:42:10 +01:00
David Pedersen
a63843d6c5
Release axum, axum-core, and axum-extra (#582) 2021-12-02 20:02:38 +01:00
David Pedersen
254d8fde17
Move FromRequest and IntoResponse into new axum-core crate (#564)
* Move `IntoResponse` to axum-core

* Move `FromRequest` to axum-core

* some clean up

* Remove hyper dependency from axum-core

* Fix docs reference

* Use default

* Update changelog

* Remove mention of default type
2021-11-30 13:46:13 +00:00
Kai Jewson
2b6dba49cb
Remove the associated Body type on IntoResponse (#571) 2021-11-28 18:52:18 +01:00
David Pedersen
6d0abd447c
axum-debug: Version 0.2.2 (#553)
- Fix regression causing errors when `#[debug_handler]` was used on functions with multiple
  extractors ([#552])

[#552]: https://github.com/tokio-rs/axum/pull/552
2021-11-22 09:40:35 +00:00
David Pedersen
27e848fbe8
Fix #[debug_handler] for multiple extractors (#552)
* Fix `#[debug_handler]` for multiple extractors

It generated a function for each extractor to check the type but those
functions didn't have unique names.

Fixed by including all idents in the `arg: Extractor` token tree in the
name of the function generated. Not sure there is a simpler way to fix
it.

* just use a counter

* don't need visit feature anymore
2021-11-22 10:28:43 +01:00
Jonas Platte
69fee5864d
Use .to_owned() instead of .to_string() to turn &str into String (#548) 2021-11-19 22:15:47 +00:00
David Pedersen
44a49cb199
axum-debug: Version 0.2.1 (#545)
- Make macro handle more cases such as mutable extractors and handlers taking
  `self` ([#518])

[#518]: https://github.com/tokio-rs/axum/pull/518
2021-11-19 20:38:30 +00:00
David Pedersen
f1f004a057
Make axum-debug handle more cases (#518)
* Make `axum-debug` handle more cases

* Only just trybuild tests on stable

* revert changes to hello-world example

* Remove a bit of duplication

* return error on generics

* address review feedback

* Support associated functions with receiver or returns `Self`

* fix indentation
2021-11-19 21:32:07 +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
david-perez
3cf8ee3b5e
Drop Sync requirement on the handler function (#522)
Since it doesn't need to be called from different threads at the same
time.
2021-11-16 15:00:56 +01:00
David Pedersen
e58336621d
axum-debug: Version 0.2.0 (#511)
- **breaking:** Removed `debug_router` macro.
- **breaking:** Removed `check_service` function.
- **breaking:** Removed `debug_service` function.
2021-11-13 20:44:13 +01:00
Jonas Platte
89db85d202
axum-debug: Move axum dependency to dev-dependencies (#506) 2021-11-13 17:38:09 +01:00
David Pedersen
c7b8813c47
Add trybuild tests for axum-debug (#501)
The things are also covered by the doc tests but this also gives us
assertions on the errors produced, which is the whole point of this
crate :)
2021-11-11 20:26:08 +00:00
David Pedersen
fb8156f17c
axum-debug readme fixes (#499)
* Fix build status badge in axum-debug

* fix links

* fix one more link
2021-11-11 16:53:07 +00:00
David Pedersen
5da3f34b3e
Clean up axum-debug crate (#498)
* Clean up axum-debug crate

Mostly just brings the crate more in line with the rest of the crates in
the workspace.

I've also removed the axum-debug-macros crate since axum-debug only
contained one re-export from axum-debug-macros. So we didn't need two
crates. Can always bring the "backend" crate back if we need things in
axum-debug that aren't proc-macros.

* Just testing: This should make CI fail

* Misc CI clean up

* fix intentional breakage

* fix changelog

* Remove rustfmt config for now as it gives warnings on stable

* Fix paths
2021-11-11 17:33:33 +01:00
Eray Karatay
f6b47478da
Move axum-debug crate to workspace (#497)
* add axum-debug to workspace

* update readme

* add changes to changelog

* little docs update

* fix the gap

a tab has leaked into workspace Cargo.toml, it must be fixed

* address clippy warnings
2021-11-11 15:18:40 +01:00