mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-08 00:00:24 +02:00
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 <[email protected]> * docs(axum-extra):` _ `-> `rejection` Co-authored-by: David Pedersen <[email protected]> * 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 <[email protected]>
This commit is contained in:
co-authored by
David Pedersen
parent
01630cfef6
commit
fb21561616
@@ -11,6 +11,8 @@ pub mod cookie;
|
||||
#[cfg(feature = "query")]
|
||||
mod query;
|
||||
|
||||
mod with_rejection;
|
||||
|
||||
pub use self::cached::Cached;
|
||||
|
||||
#[cfg(feature = "cookie")]
|
||||
@@ -31,3 +33,5 @@ pub use self::query::Query;
|
||||
#[cfg(feature = "json-lines")]
|
||||
#[doc(no_inline)]
|
||||
pub use crate::json_lines::JsonLines;
|
||||
|
||||
pub use self::with_rejection::WithRejection;
|
||||
|
||||
Reference in New Issue
Block a user