mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-28 01:52:57 +01:00
rename extract to types
This commit is contained in:
parent
4a4826b23a
commit
725ee3d396
@ -6,18 +6,6 @@ use futures::{future, Async, Future, IntoFuture, Poll};
|
|||||||
|
|
||||||
use crate::service::ServiceFromRequest;
|
use crate::service::ServiceFromRequest;
|
||||||
|
|
||||||
mod form;
|
|
||||||
mod json;
|
|
||||||
mod path;
|
|
||||||
mod payload;
|
|
||||||
mod query;
|
|
||||||
|
|
||||||
pub use self::form::{Form, FormConfig};
|
|
||||||
pub use self::json::{Json, JsonConfig};
|
|
||||||
pub use self::path::Path;
|
|
||||||
pub use self::payload::{Payload, PayloadConfig};
|
|
||||||
pub use self::query::Query;
|
|
||||||
|
|
||||||
/// Trait implemented by types that can be extracted from request.
|
/// Trait implemented by types that can be extracted from request.
|
||||||
///
|
///
|
||||||
/// Types that implement this trait can be used with `Route` handlers.
|
/// Types that implement this trait can be used with `Route` handlers.
|
||||||
@ -250,6 +238,7 @@ mod tests {
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::test::{block_on, TestRequest};
|
use crate::test::{block_on, TestRequest};
|
||||||
|
use crate::types::{Form, FormConfig, Path, Query};
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, PartialEq)]
|
#[derive(Deserialize, Debug, PartialEq)]
|
||||||
struct Info {
|
struct Info {
|
@ -19,6 +19,7 @@ mod scope;
|
|||||||
mod server;
|
mod server;
|
||||||
mod service;
|
mod service;
|
||||||
pub mod test;
|
pub mod test;
|
||||||
|
mod types;
|
||||||
|
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
@ -93,9 +94,9 @@ pub mod web {
|
|||||||
use crate::scope::Scope;
|
use crate::scope::Scope;
|
||||||
|
|
||||||
pub use crate::data::{Data, RouteData};
|
pub use crate::data::{Data, RouteData};
|
||||||
pub use crate::extract::{Form, Json, Path, Payload, Query};
|
|
||||||
pub use crate::extract::{FormConfig, JsonConfig, PayloadConfig};
|
|
||||||
pub use crate::request::HttpRequest;
|
pub use crate::request::HttpRequest;
|
||||||
|
pub use crate::types::{Form, Json, Path, Payload, Query};
|
||||||
|
pub use crate::types::{FormConfig, JsonConfig, PayloadConfig};
|
||||||
|
|
||||||
/// Create resource for a specific path.
|
/// Create resource for a specific path.
|
||||||
///
|
///
|
||||||
|
13
src/types/mod.rs
Normal file
13
src/types/mod.rs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
//! Helper types
|
||||||
|
|
||||||
|
mod form;
|
||||||
|
mod json;
|
||||||
|
mod path;
|
||||||
|
mod payload;
|
||||||
|
mod query;
|
||||||
|
|
||||||
|
pub use self::form::{Form, FormConfig};
|
||||||
|
pub use self::json::{Json, JsonConfig};
|
||||||
|
pub use self::path::Path;
|
||||||
|
pub use self::payload::{Payload, PayloadConfig};
|
||||||
|
pub use self::query::Query;
|
@ -8,8 +8,7 @@ use serde::de;
|
|||||||
|
|
||||||
use crate::request::HttpRequest;
|
use crate::request::HttpRequest;
|
||||||
use crate::service::ServiceFromRequest;
|
use crate::service::ServiceFromRequest;
|
||||||
|
use crate::FromRequest;
|
||||||
use super::FromRequest;
|
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||||
/// Extract typed information from the request's path.
|
/// Extract typed information from the request's path.
|
Loading…
Reference in New Issue
Block a user