Commit Graph
27 Commits
Author SHA1 Message Date
Jonas PlatteandGitHub 89e9d1bff1 Put the Form and Query extractors behind (default-on) Cargo features (#775)
* Put the Form extractor behind a (default-activated) Cargo feature

* Put the Query behind a (default-activated) Cargo feature
2022-02-22 10:12:24 +01:00
Jonas PlatteandGitHub 2b608c4532 Fix doc(cfg)s (#765)
* Use automatic doc(cfg) attributes where possible

* Add missing feature documentation

* Replace redundant cfg attribute with doc(cfg)

* Remove non-existent feature from package.metadata.playground.features

* Add missing cfg's on rejection types
2022-02-17 11:43:16 +01:00
Jonas PlatteandDavid Pedersen 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
Jonas PlatteandDavid Pedersen e0a463b463 Optional extractor extensions (#685)
* Fix inconsistent indentation in axum/Cargo.toml

* Make MatchedPath and OriginalUri extractors and logic for them optional

… they add some runtime cost to handling any request that goes through
a Router, which only makes sense if they actually get used.

Enable both features by default for convenience.
2022-01-23 18:01:52 +01:00
Jonas PlatteandGitHub 616a43aaa3 Simplify graceful shutdown (#673) 2021-12-28 16:23:07 +01:00
Jonas PlatteandGitHub a3e19465ac Move header name validity checks to compile time (#661) 2021-12-27 18:25:47 +01:00
Jonas PlatteandGitHub 0a399ed0fa A few small refactorings (#655)
* Simplify json content-type check

* Import HeaderMap from http instead of from headers

The headers crate is an optional dependency and its HeaderMap re-export
is `#[doc(hidden)]`.

* Use headers re-export in axum in examples
2021-12-27 14:02:38 +01:00
Jonas PlatteandGitHub ce6ad399ef Fix a typo (#635) 2021-12-17 13:15:07 +01:00
Jonas PlatteandGitHub f7049054bf Re-export the headers crate when the headers feature is active (#630) 2021-12-15 15:14:03 +01:00
Jonas PlatteandGitHub b1623ce7f2 Add AddExtension::layer (#607) 2021-12-10 22:56:56 +01:00
Jonas PlatteandGitHub c8c0bb2ce1 Fix a typo (#605) 2021-12-10 18:34:31 +01:00
Jonas PlatteandGitHub 69fee5864d Use .to_owned() instead of .to_string() to turn &str into String (#548) 2021-11-19 22:15:47 +00:00
Jonas PlatteandGitHub b43b9ed69d Add axum_extra::response::ErasedJson (#537) 2021-11-17 22:54:02 +01:00
Jonas PlatteandGitHub 2bfd51372e Use named constants for static header values (#535)
Improves performance by moving some computation to compile time.
2021-11-17 19:53:07 +00:00
Jonas PlatteandGitHub 89db85d202 axum-debug: Move axum dependency to dev-dependencies (#506) 2021-11-13 17:38:09 +01:00
Jonas PlatteandGitHub 9c77ee0295 Use nightly clippy & rustfmt for more style checks (#487) 2021-11-09 11:53:57 +00:00
Jonas PlatteandGitHub bcd18a03bc Split first sentence into its own paragraph in TypedHeader docs (#485) 2021-11-09 12:14:42 +01:00
Jonas PlatteandGitHub b4b022da5f Add turbo.fish to community showcase (#466) 2021-11-05 13:23:53 +01:00
Jonas PlatteandGitHub 2ba9cdce45 Fix typos in CHANGELOG.md (#449) 2021-11-02 20:12:27 +00:00
Jonas PlatteandGitHub d29c1f26c2 Bump minimum version of async-trait (#369)
Older versions generate invalid code for Handler impls.
2021-10-06 20:46:10 +02:00
Jonas PlatteandGitHub 250ea0cfef Make JSON and HTTP1 support optional (#286)
* Make json support an optional feature

* Fix Json type documentation

* Make hyper's http1 feature optional
2021-10-02 15:46:33 +02:00
Jonas PlatteandGitHub e41bac7f39 Expose hyper's http2 feature flag (#279)
* Order features alphabetically

… in Cargo.toml and crate docs.

* Improve ws feature docs

* Expose hyper's http2 feature flag
2021-08-27 08:58:50 +00:00
Jonas PlatteandGitHub ab207af060 Rename .route() / .nest() "description" to "path" (#265) 2021-08-24 19:29:28 +02:00
Jonas PlatteandGitHub 536b8ca4ec Add Redirect::to constructor (#255)
The motivation for this is established in the issue it fixes.

Resolves #248
2021-08-24 12:13:18 +02:00
Jonas PlatteandGitHub 6a042a9b3a Cleanup CI (#141)
* Feature-gate test that depends on non-default features

Makes `cargo check` work without extra flags.

* Don't set doc(html_root_url)

It is no longer recommended:
https://github.com/rust-lang/api-guidelines/pull/230

* Remove documentation URL from Cargo.toml

crates.io will link to the right version on docs.rs automatically.

* Ensure toolchains installed by actions-rs/toolchain are actually used

* Fix missing rustup component in check job

* Raise MSRV to 1.51

Older versions weren't actually working before.

* Only run clippy & rustfmt on stable toolchain

MSRV is checked in test-versions.

* Allow cargo doc to succeed without headers and multipart features

CI will still ensure that intra-doc links that rely on these are not broken.
2021-08-07 11:06:42 +02:00
Jonas PlatteandGitHub d285dfb568 Tell clippy about MSRV (#114)
* Remove unused import

* Tell clippy about MSRV
2021-08-04 12:15:58 +02:00
Jonas PlatteandGitHub 015f6e0c21 Fix typos found by typos-cli (#113) 2021-08-04 12:09:39 +02:00