mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-30 18:34:36 +01:00
rearrange exports
This commit is contained in:
parent
968f5d39d6
commit
dff7618f35
@ -12,6 +12,7 @@ if this methods get call for the same builder instance, builder will panic.
|
|||||||
```rust
|
```rust
|
||||||
# extern crate actix_web;
|
# extern crate actix_web;
|
||||||
use actix_web::*;
|
use actix_web::*;
|
||||||
|
use actix_web::headers::ContentEncoding;
|
||||||
|
|
||||||
fn index(req: HttpRequest) -> HttpResponse {
|
fn index(req: HttpRequest) -> HttpResponse {
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
@ -45,6 +46,7 @@ to enable `brotli` response's body compression use `ContentEncoding::Br`:
|
|||||||
```rust
|
```rust
|
||||||
# extern crate actix_web;
|
# extern crate actix_web;
|
||||||
use actix_web::*;
|
use actix_web::*;
|
||||||
|
use actix_web::headers::ContentEncoding;
|
||||||
|
|
||||||
fn index(req: HttpRequest) -> HttpResponse {
|
fn index(req: HttpRequest) -> HttpResponse {
|
||||||
HttpResponse::Ok()
|
HttpResponse::Ok()
|
||||||
|
@ -6,10 +6,10 @@ use std::collections::HashMap;
|
|||||||
use bytes::BytesMut;
|
use bytes::BytesMut;
|
||||||
use futures::{Async, Future, Stream, Poll};
|
use futures::{Async, Future, Stream, Poll};
|
||||||
use url::{Url, form_urlencoded};
|
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 http::{header, Uri, Method, Version, HeaderMap, Extensions};
|
||||||
|
|
||||||
use Cookie;
|
|
||||||
use info::ConnectionInfo;
|
use info::ConnectionInfo;
|
||||||
use param::Params;
|
use param::Params;
|
||||||
use router::Router;
|
use router::Router;
|
||||||
|
@ -8,7 +8,8 @@ use http::{StatusCode, Version, HeaderMap, HttpTryFrom, Error as HttpError};
|
|||||||
use http::header::{self, HeaderName, HeaderValue};
|
use http::header::{self, HeaderName, HeaderValue};
|
||||||
use serde_json;
|
use serde_json;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use Cookie;
|
use cookie::Cookie;
|
||||||
|
|
||||||
use body::Body;
|
use body::Body;
|
||||||
use error::Error;
|
use error::Error;
|
||||||
use handler::FromRequest;
|
use handler::FromRequest;
|
||||||
|
19
src/lib.rs
19
src/lib.rs
@ -81,10 +81,9 @@ pub mod multipart;
|
|||||||
pub mod middlewares;
|
pub mod middlewares;
|
||||||
pub mod pred;
|
pub mod pred;
|
||||||
pub use error::{Error, Result};
|
pub use error::{Error, Result};
|
||||||
pub use encoding::ContentEncoding;
|
|
||||||
pub use body::{Body, Binary};
|
pub use body::{Body, Binary};
|
||||||
pub use application::Application;
|
pub use application::Application;
|
||||||
pub use httprequest::{HttpRequest, UrlEncoded};
|
pub use httprequest::HttpRequest;
|
||||||
pub use httpresponse::HttpResponse;
|
pub use httpresponse::HttpResponse;
|
||||||
pub use payload::{Payload, PayloadItem};
|
pub use payload::{Payload, PayloadItem};
|
||||||
pub use handler::{Reply, Json, FromRequest};
|
pub use handler::{Reply, Json, FromRequest};
|
||||||
@ -95,7 +94,6 @@ pub use context::HttpContext;
|
|||||||
|
|
||||||
// re-exports
|
// re-exports
|
||||||
pub use http::{Method, StatusCode, Version};
|
pub use http::{Method, StatusCode, Version};
|
||||||
pub use cookie::Cookie;
|
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[cfg(feature="tls")]
|
#[cfg(feature="tls")]
|
||||||
@ -105,6 +103,16 @@ pub use native_tls::Pkcs12;
|
|||||||
#[cfg(feature="openssl")]
|
#[cfg(feature="openssl")]
|
||||||
pub use openssl::pkcs12::Pkcs12;
|
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 {
|
pub mod dev {
|
||||||
//! The `actix-web` prelude for library developers
|
//! The `actix-web` prelude for library developers
|
||||||
//!
|
//!
|
||||||
@ -116,16 +124,13 @@ pub mod dev {
|
|||||||
//! use actix_web::dev::*;
|
//! use actix_web::dev::*;
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
// dev specific
|
|
||||||
pub use info::ConnectionInfo;
|
pub use info::ConnectionInfo;
|
||||||
pub use handler::Handler;
|
pub use handler::Handler;
|
||||||
pub use router::{Router, Pattern};
|
pub use router::{Router, Pattern};
|
||||||
pub use pipeline::Pipeline;
|
pub use pipeline::Pipeline;
|
||||||
pub use channel::{HttpChannel, HttpHandler, IntoHttpHandler};
|
pub use channel::{HttpChannel, HttpHandler, IntoHttpHandler};
|
||||||
// pub use recognizer::RouteRecognizer;
|
|
||||||
pub use param::{FromParam, Params};
|
pub use param::{FromParam, Params};
|
||||||
|
|
||||||
pub use cookie::CookieBuilder;
|
pub use httprequest::UrlEncoded;
|
||||||
pub use http_range::HttpRange;
|
|
||||||
pub use httpresponse::HttpResponseBuilder;
|
pub use httpresponse::HttpResponseBuilder;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ fn test_response_cookies() {
|
|||||||
|
|
||||||
let resp = httpcodes::HTTPOk
|
let resp = httpcodes::HTTPOk
|
||||||
.build()
|
.build()
|
||||||
.cookie(Cookie::build("name", "value")
|
.cookie(headers::Cookie::build("name", "value")
|
||||||
.domain("www.rust-lang.org")
|
.domain("www.rust-lang.org")
|
||||||
.path("/test")
|
.path("/test")
|
||||||
.http_only(true)
|
.http_only(true)
|
||||||
|
Loading…
Reference in New Issue
Block a user