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:
parent
4a4826b23a
commit
725ee3d396
8 changed files with 18 additions and 16 deletions
|
@ -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 {
|
|
@ -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
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::service::ServiceFromRequest;
|
||||
|
||||
use super::FromRequest;
|
||||
use crate::FromRequest;
|
||||
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||
/// Extract typed information from the request's path.
|
Loading…
Reference in a new issue