Commit graph

1506 commits

Author SHA1 Message Date
Max Countryman
95c6621db9
Improve workspace caching on CI (#1229)
* improve workspace caching

This improves workspace caching performance by using the workspace parameter of rust-cache@v2.

* apply the same technique here as well
2022-08-09 15:18:10 +02:00
Abdulla Abdurakhmanov
79a0a54bc9
Updated ECOSYSTEM with axum-streams reference (#1213) 2022-07-31 14:47:51 +00:00
Jas
f7860b6f00
Update ECOSYSTEM.md (#1212) 2022-07-31 07:13:09 +00:00
Jonas Platte
f0f60681ef
Fix intra-doc links on docs.rs (#1205)
* Use version 2 of Cargo's feature resolver

* Increase minimum version of tungstenite

Tungstenite 0.17.1 has a higher MSRV, and there should be no reason to
use it over 0.17.2.

* Clean up and fix MSRV CI job

* Fix some intra-doc links not resolving correctly on docs.rs

* Bump minimum version of tower

… to avoid dependencies with a broken minimum-versions chain.
2022-07-28 19:14:31 +02:00
Jonas Platte
141198ce19
Declare MSRV in Cargo manifests, not .clippy.toml (#1206) 2022-07-28 15:31:47 +02:00
Jonas Platte
e6fb53fd68
Fix a typo in axum_extra::extract::Query docs (#1201) 2022-07-27 16:32:21 +02:00
Péter Leéh
6ff1c2111e
Fix comment typos in stream-to-file example (#1200) 2022-07-27 11:10:00 +00:00
jord&
d7f2c140bc
Add rgit to ECOSYSTEM.md (#1197) 2022-07-27 03:39:09 +00:00
Lex Cao
3c0778b16d
Add an example for head request (#1189)
As #84 add get-head request, adding an example.
2022-07-26 20:19:03 +02:00
Ryan Fowler
7e7a2f2058
Create BytesMut for Json with initial capacity (#1196)
* Create BytesMut for Json with initial capacity

* Add a comment explaining BytesMut initial capacity

* Update link to serde_json::to_vec function to docs.rs
2022-07-26 16:45:58 +02:00
David Pedersen
3bcc8fb07d fix typo in CI.yml 2022-07-26 14:03:35 +02:00
David Pedersen
10ab8c7aba
Add missing cfg to axum_extra::extract::Form (#1194) 2022-07-26 00:25:45 +02:00
David Pedersen
234c8ccb13
Improve build times by generating less IR (#1192)
* example

* `MethodRouter::merge`

* `set_content_length` and `set_allow_header`

* `MethodRouter::on_service_boxed_response_body`

* `Router::route`

* `MethodRouter::merge` again

* `MethodRouter::on_service_boxed_response_body`

* `Router::call_route`

* `MethodRouter::{layer, route_layer}`

* revert example

* fix test

* move function to method on `AllowHeader`
2022-07-25 18:06:37 +00:00
Marek Kuskowski
1ace8554ce
Add ws example showing how to pass data to callback (#1185) 2022-07-23 16:27:36 +00:00
Sugih Jamin
4558671a0b
Redirect HTTP to HTTPS in tls-rustls example (#1166) 2022-07-23 10:23:40 +02:00
Johannes Henninger
bb309319ff
Fix typo in ECOSYSTEM.md (#1183) 2022-07-22 12:20:34 +02:00
Carlos Armando Marcano Vargas
216c89e44c
Add link to Axum tutorial (#1181) 2022-07-21 20:56:33 +00:00
Kartavya Vashishtha
cf09f62a1a
Add example for multiple listen addrs (#1179) 2022-07-20 18:33:12 +00:00
Jonas Platte
a3cf025d54
Serialize Json<T> to Bytes instead of Vec<u8> in IntoResponse (#1178) 2022-07-20 16:32:08 +00:00
azzamsa
a3eaa332e4
test: use ready() and call() to avoid using clone() (#1176) 2022-07-20 12:19:15 +00:00
David Pedersen
b243e171fd
Accept S::Response: IntoResponse everywhere (#1165) 2022-07-19 18:55:15 +02:00
LingDu
643909af6d
Add axum-admin to ECOSYSTEM.md (#1173)
* Update ECOSYSTEM.md

add axum_admin

* Update ECOSYSTEM.md

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-07-19 18:04:57 +02:00
Allan
928d60fbba
Fix two comment typos (#1172) 2022-07-18 17:16:38 +00:00
SzudemJ
73041c8988
Avoid exposure of type names by QueryRejection (#1171) 2022-07-18 13:43:18 +00:00
David Pedersen
329bd5f9b4
Support any middleware response that implements IntoResponse (#1152)
* Support any middleware response that implements `IntoResponse`

* Require `Infallible` for middleware added with `Handler::layer`
2022-07-13 08:38:19 +00:00
Oskar
0a7fdd0b05
add HomeDisk to Project showcase (#1156) 2022-07-11 19:22:01 +02:00
David Pedersen
92dbbd3182
Return rejection if WebSocket request couldn't be upgraded (#1135)
* Return rejection if `WebSocket` request couldn't be upgraded

* make rejection about connection upgrades

* changelog links
2022-07-11 14:33:55 +02:00
David Pedersen
8c9998eab7
Don't derive debug impl for Resource (#1153)
We don't actually require `B` to be `Debug` but the derived impl does.
2022-07-11 09:41:41 +02:00
David Pedersen
bed0b83421 Add http-server as crates.io subcategory 2022-07-10 14:28:11 +02:00
Dominik Spicher
bc55362ba8
Fix typos in RequestParts docstrings (#1147) 2022-07-08 13:26:34 +00:00
David Pedersen
605980b21c Add introduction to axum talk to ECOSYSTEM.md 2022-07-07 22:48:30 +02:00
David Pedersen
2966407dc1
Re-export debug_handler from axum (#1144)
* Re-export `debug_handler` from axum

Fixes #1143

* also axum-extra
2022-07-04 09:10:52 +00:00
David Pedersen
2e80ebd18d Support running extractors from middleware::from_fn 2022-07-03 16:49:20 +02:00
David Pedersen
f8c8f5b697 Add note about breaking changes to readme 2022-07-02 11:46:53 +02:00
David Pedersen
eff3b716d3
Document running extractors from middleware (#1140)
Fixes #1134
2022-07-02 09:44:17 +00:00
Jonas Platte
8c31bee9bc
docsrs cfg fixes (#1137)
* Remove unused attribute in axum-core

* Fix docs.rs package metadata for axum-extra
2022-07-01 13:35:52 +02:00
NicolaLS
34146f3139
Implement TryFrom<Method> for MethodFilter (#1130)
* implement TryFrom<http::Method> for MethodFilter

* test for TryFrom<http::Method> for MethodFilter

* 'UnsupportedMethod' error type for MethodFilter

* Log TryFrom<http::Method> for MethodFilter

* adjust docs

* move docs

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-07-01 08:37:41 +00:00
David Pedersen
698b5ccf39 Update trybuilds for rust 1.62 2022-07-01 10:24:15 +02:00
David Pedersen
a4c820420d
Remove trailing slash redirects (#1119)
* Prepare axum-next branch

* Remove deprecated `extractor_middleware` function (#1077)

* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` (#948)

* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` (#924)

* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}`

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

* changelog

* fixup changelog

* Panic on overlapping routes in `MethodRouter` (#1102)

* Panic on overlapping routes in `MethodRouter`

* changelog link

* add test to ensure `head` and `get` don't overlap

* Fix changelog

* Prepare axum-next branch

* Remove trailing slash redirects

* changelog link

* Fix changelog

* remove asserting to make make the test more clear

* remove tsr related feature

* Add `RouterExt::route_with_tsr`

* Apply suggestions from code review

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

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

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

* fix typos in docs

* Update axum/CHANGELOG.md

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

* mention `RouterExt::route_with_tsr` in the changelog

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-06-30 00:22:43 +02:00
David Pedersen
23808f72a2 Fix changelog 2022-06-28 22:07:10 +02:00
David Pedersen
2b386c0baa Panic on overlapping routes in MethodRouter (#1102)
* Panic on overlapping routes in `MethodRouter`

* changelog link

* add test to ensure `head` and `get` don't overlap
2022-06-28 22:07:10 +02:00
David Pedersen
661473dcbc Allow Error: Into<Infallible> for Route::{layer, route_layer} (#948)
* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` (#924)

* Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}`

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

* changelog

* fixup changelog
2022-06-28 22:07:10 +02:00
David Pedersen
56ddabcd7d Remove deprecated extractor_middleware function (#1077) 2022-06-28 22:07:10 +02:00
David Pedersen
7e794e9d1d
axum: Version 0.5.10 (#1128) 2022-06-28 21:32:39 +02:00
David Pedersen
a8d0ce8c03
Fix possible panic when doing trailing slash redirect (#1124)
* Fix possible panic when doing trailing slash redirect

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

* changelog link

* Update axum/src/routing/mod.rs

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-06-28 16:58:13 +02:00
David Pedersen
905bbfb8e2
axum-extra: Version 0.3.5 (#1125) 2022-06-27 21:08:12 +02:00
David Pedersen
b10c9d34bd
axum-macros: Version 0.2.3 (#1126) 2022-06-27 21:06:59 +02:00
David Pedersen
11179b8033
Silence "unnecessary use of to_string" lint for #[derive(TypedPath)] (#1117)
* Fix "unnecessary use of `to_string`" lint for `#[derive(TypedPath)]`

* changelog

* Update axum-macros/CHANGELOG.md
2022-06-27 18:57:02 +00:00
David Pedersen
f6b1d35c51
Use minimal dependency versions for MSRV tests on CI (#1109) 2022-06-27 20:44:20 +02:00
David Pedersen
cb207472f4
Make Router faster to clone (#1123)
* Make `Router` faster to clone

* changelog

* Update axum/src/routing/mod.rs

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

* fix

* Update axum/src/routing/mod.rs

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-06-27 11:00:19 +02:00