From 1ac390e2d94bdbe386c3dee26bc80e7216ce1f9f Mon Sep 17 00:00:00 2001 From: Glitch Date: Tue, 9 Mar 2021 15:37:54 +0100 Subject: Add warp support (#46) * add tracing, add tests, default to empty string --- src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 4604859..4df1d00 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; -- cgit v1.2.3