1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-21 07:36:43 +00:00

rename extract to types

This commit is contained in:
Nikolay Kim 2019-03-16 21:43:48 -07:00
parent 4a4826b23a
commit 725ee3d396
8 changed files with 18 additions and 16 deletions

View file

@ -6,18 +6,6 @@ use futures::{future, Async, Future, IntoFuture, Poll};
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.
///
/// Types that implement this trait can be used with `Route` handlers.
@ -250,6 +238,7 @@ mod tests {
use super::*;
use crate::test::{block_on, TestRequest};
use crate::types::{Form, FormConfig, Path, Query};
#[derive(Deserialize, Debug, PartialEq)]
struct Info {

View file

@ -19,6 +19,7 @@ mod scope;
mod server;
mod service;
pub mod test;
mod types;
#[allow(unused_imports)]
#[macro_use]
@ -93,9 +94,9 @@ pub mod web {
use crate::scope::Scope;
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::types::{Form, Json, Path, Payload, Query};
pub use crate::types::{FormConfig, JsonConfig, PayloadConfig};
/// Create resource for a specific path.
///

13
src/types/mod.rs Normal file
View 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;

View file

@ -8,8 +8,7 @@ use serde::de;
use crate::request::HttpRequest;
use crate::service::ServiceFromRequest;
use super::FromRequest;
use crate::FromRequest;
#[derive(PartialEq, Eq, PartialOrd, Ord)]
/// Extract typed information from the request's path.