axum/examples
Altair Bueno fb21561616
Add WithRejection (#1262)
* new(axum-extra): Added `WithRejection` base impl

Based on @jplatte's version (https://github.com/tokio-rs/axum/issues/1116#issuecomment-1215048273), with slight changes

- Using `From<E::Rejection>` to define the trait bound on a more concise way
- Renamed variables to something more meaningfull

* revert(axum-extra): Removed `with_rejection` feat

* ref(axum-extra): Replaced `match` with `?`

* tests(axum-extra): Added test for `WithRejection`

* examples: Replaced custom `Json` extractor with `WithRejection`

* docs(axum-extra): Added doc to `WithRejection`

* fmt(cargo-check): removed whitespaces

* fmt(customize-extractor-error): missing fmt

* docs(axum-extra): doctest includes `Handler` test

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* docs(axum-extra):` _ `-> `rejection`

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* docs(axum-extra): fixed suggestions

* fix(axum-extra): `WithRejection` manual trait impl

* revert(customize-extractor-error): Undo example changes

refs: d878eede18 , f9200bf4b9

* example(customize-extractor-error): Added reference to `WithRejection`

* docs(axum-extra): Removed `customize-extractor-error` reference

* fmt(axum-extra): cargo fmt

* docs(axum-extra): Added `WithRejection` to CHANGELOG.md

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-08-17 07:59:25 +00:00
..
async-graphql Replace async-graphql with link to async-graphql's own examples (#1234) 2022-08-09 14:56:50 +00:00
chat Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
consume-body-in-extractor-or-middleware Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
cors Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
customize-extractor-error Add WithRejection (#1262) 2022-08-17 07:59:25 +00:00
customize-path-rejection Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
error-handling-and-dependency-injection Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
form Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
global-404-handler Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
graceful-shutdown Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
handle-head-request Add an example for head request (#1189) 2022-07-26 20:19:03 +02:00
hello-world Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
http-proxy Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
jwt Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
key-value-store Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
listen-multiple-addrs Add example for multiple listen addrs (#1179) 2022-07-20 18:33:12 +00:00
low-level-rustls Improve performance in low-level-rustls example (#1254) 2022-08-12 11:57:59 +00:00
multipart-form Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
oauth Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
print-request-response Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
prometheus-metrics Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
query-params-with-empty-strings Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
readme Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
rest-grpc-multiplex Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
reverse-proxy Remove explicit TryFrom, TryInto imports (#1099) 2022-06-17 18:36:49 +00:00
routes-and-handlers-close-together Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
sessions Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
sqlx-postgres Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
sse Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
static-file-server Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
stream-to-file Fix comment typos in stream-to-file example (#1200) 2022-07-27 11:10:00 +00:00
templates Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
testing test: use ready() and call() to avoid using clone() (#1176) 2022-07-20 12:19:15 +00:00
tls-rustls Redirect HTTP to HTTPS in tls-rustls example (#1166) 2022-07-23 10:23:40 +02:00
todos Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
tokio-postgres Fix two comment typos (#1172) 2022-07-18 17:16:38 +00:00
tracing-aka-logging Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
unix-domain-socket Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
validator Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
versioning Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
websockets Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
Cargo.toml Replace async-graphql with link to async-graphql's own examples (#1234) 2022-08-09 14:56:50 +00:00
README.md Restructure community showcase (#454) 2021-11-03 09:20:01 +01:00

Examples

This folder contains numerous example showing how to use axum. Each example is setup as its own crate so its dependencies are clear.

For a list of what the community built with axum, please see the list here.