1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-07-06 14:05:47 +00:00

rearrange exports

This commit is contained in:
Nikolay Kim 2017-12-07 16:40:29 -08:00
parent 968f5d39d6
commit dff7618f35
5 changed files with 19 additions and 11 deletions

View file

@ -12,6 +12,7 @@ if this methods get call for the same builder instance, builder will panic.
```rust
# extern crate actix_web;
use actix_web::*;
use actix_web::headers::ContentEncoding;
fn index(req: HttpRequest) -> HttpResponse {
HttpResponse::Ok()
@ -45,6 +46,7 @@ to enable `brotli` response's body compression use `ContentEncoding::Br`:
```rust
# extern crate actix_web;
use actix_web::*;
use actix_web::headers::ContentEncoding;
fn index(req: HttpRequest) -> HttpResponse {
HttpResponse::Ok()

View file

@ -6,10 +6,10 @@ use std::collections::HashMap;
use bytes::BytesMut;
use futures::{Async, Future, Stream, Poll};
use url::{Url, form_urlencoded};
pub use http_range::HttpRange;
use cookie::Cookie;
use http_range::HttpRange;
use http::{header, Uri, Method, Version, HeaderMap, Extensions};
use Cookie;
use info::ConnectionInfo;
use param::Params;
use router::Router;

View file

@ -8,7 +8,8 @@ use http::{StatusCode, Version, HeaderMap, HttpTryFrom, Error as HttpError};
use http::header::{self, HeaderName, HeaderValue};
use serde_json;
use serde::Serialize;
use Cookie;
use cookie::Cookie;
use body::Body;
use error::Error;
use handler::FromRequest;

View file

@ -81,10 +81,9 @@ pub mod multipart;
pub mod middlewares;
pub mod pred;
pub use error::{Error, Result};
pub use encoding::ContentEncoding;
pub use body::{Body, Binary};
pub use application::Application;
pub use httprequest::{HttpRequest, UrlEncoded};
pub use httprequest::HttpRequest;
pub use httpresponse::HttpResponse;
pub use payload::{Payload, PayloadItem};
pub use handler::{Reply, Json, FromRequest};
@ -95,7 +94,6 @@ pub use context::HttpContext;
// re-exports
pub use http::{Method, StatusCode, Version};
pub use cookie::Cookie;
#[doc(hidden)]
#[cfg(feature="tls")]
@ -105,6 +103,16 @@ pub use native_tls::Pkcs12;
#[cfg(feature="openssl")]
pub use openssl::pkcs12::Pkcs12;
pub mod headers {
//! Headers implementation
pub use encoding::ContentEncoding;
pub use cookie::Cookie;
pub use cookie::CookieBuilder;
pub use http_range::HttpRange;
}
pub mod dev {
//! The `actix-web` prelude for library developers
//!
@ -116,16 +124,13 @@ pub mod dev {
//! use actix_web::dev::*;
//! ```
// dev specific
pub use info::ConnectionInfo;
pub use handler::Handler;
pub use router::{Router, Pattern};
pub use pipeline::Pipeline;
pub use channel::{HttpChannel, HttpHandler, IntoHttpHandler};
// pub use recognizer::RouteRecognizer;
pub use param::{FromParam, Params};
pub use cookie::CookieBuilder;
pub use http_range::HttpRange;
pub use httprequest::UrlEncoded;
pub use httpresponse::HttpResponseBuilder;
}

View file

@ -20,7 +20,7 @@ fn test_response_cookies() {
let resp = httpcodes::HTTPOk
.build()
.cookie(Cookie::build("name", "value")
.cookie(headers::Cookie::build("name", "value")
.domain("www.rust-lang.org")
.path("/test")
.http_only(true)