diff options
author | Glitch <smallglitch@cryptolab.net> | 2021-03-09 15:37:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-09 09:37:54 -0500 |
commit | 1ac390e2d94bdbe386c3dee26bc80e7216ce1f9f (patch) | |
tree | af8b22ce5c9cccb40a9f1addd60b45573de322d4 /src/lib.rs | |
parent | 69b6269893c003911f86563d1e59750b735c2685 (diff) |
Add warp support (#46)
* add tracing, add tests, default to empty string
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -159,6 +159,20 @@ //! ``` //! //! Support for `actix-web 2.0.0` is available via the `actix2` feature. +//! +//! ## Use with `warp` filters +//! +//! The `warp` feature enables the use of `serde_qs::warp::query()`, which +//! is a substitute for the `warp::query::query()` filter and can be used like this: +//! +//! ```ignore +//! serde_qs::warp::query(Config::default()) +//! .and_then(|info| async move { +//! Ok::<_, Rejection>(format!("Welcome {}!", info.username)) +//! }) +//! .recover(serde_qs::warp::recover_fn); +//! ``` +//! #[macro_use] extern crate serde; @@ -168,6 +182,8 @@ pub mod actix; mod de; mod error; mod ser; +#[cfg(feature = "warp")] +pub mod warp; #[doc(inline)] pub use de::Config; |