Skip to content

Commit

Permalink
migrate actix-web to std::future
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Nov 21, 2019
1 parent d081e57 commit 3127dd4
Show file tree
Hide file tree
Showing 46 changed files with 4,381 additions and 3,967 deletions.
88 changes: 42 additions & 46 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-web"
version = "1.0.9"
version = "2.0.0-alpha.1"
authors = ["Nikolay Kim <[email protected]>"]
description = "Actix web is a simple, pragmatic and extremely fast web framework for Rust."
readme = "README.md"
Expand All @@ -16,7 +16,7 @@ exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"]
edition = "2018"

[package.metadata.docs.rs]
features = ["ssl", "brotli", "flate2-zlib", "secure-cookies", "client", "rust-tls", "uds"]
features = ["openssl", "rustls", "brotli", "flate2-zlib", "secure-cookies", "client"]

[badges]
travis-ci = { repository = "actix/actix-web", branch = "master" }
Expand All @@ -28,20 +28,19 @@ path = "src/lib.rs"

[workspace]
members = [
# ".",
# "awc",
# #"actix-http",
# "actix-cors",
# "actix-files",
# "actix-framed",
# "actix-session",
# "actix-identity",
# "actix-multipart",
# "actix-web-actors",
# "actix-web-codegen",
# "test-server",
".",
"awc",
"actix-http",
"actix-cors",
"actix-files",
"actix-framed",
"actix-session",
"actix-identity",
"actix-multipart",
"actix-web-actors",
"actix-web-codegen",
"test-server",
]
exclude = ["awc", "actix-http", "test-server"]

[features]
default = ["brotli", "flate2-zlib", "client", "fail"]
Expand All @@ -64,37 +63,35 @@ secure-cookies = ["actix-http/secure-cookies"]
fail = ["actix-http/fail"]

# openssl
ssl = ["openssl", "actix-server/ssl", "awc/ssl"]
openssl = ["open-ssl", "actix-server/openssl", "awc/openssl"]

# rustls
rust-tls = ["rustls", "actix-server/rust-tls", "awc/rust-tls"]

# unix domain sockets support
uds = ["actix-server/uds"]
rustls = ["rust-tls", "actix-server/rustls", "awc/rustls"]

[dependencies]
actix-codec = "0.1.2"
actix-service = "0.4.1"
actix-utils = "0.4.4"
actix-codec = "0.2.0-alpha.1"
actix-service = "1.0.0-alpha.1"
actix-utils = "0.5.0-alpha.1"
actix-router = "0.1.5"
actix-rt = "0.2.4"
actix-rt = "1.0.0-alpha.1"
actix-web-codegen = "0.1.2"
actix-http = "0.2.11"
actix-server = "0.6.1"
actix-server-config = "0.1.2"
actix-testing = "0.1.0"
actix-threadpool = "0.1.1"
awc = { version = "0.2.7", optional = true }
actix-http = "0.3.0-alpha.1"
actix-server = "0.8.0-alpha.1"
actix-server-config = "0.3.0-alpha.1"
actix-testing = "0.3.0-alpha.1"
actix-threadpool = "0.2.0-alpha.1"
awc = { version = "0.3.0-alpha.1", optional = true }

bytes = "0.4"
derive_more = "0.15.0"
encoding_rs = "0.8"
futures = "0.1.25"
futures = "0.3.1"
hashbrown = "0.6.3"
log = "0.4"
mime = "0.3"
net2 = "0.2.33"
parking_lot = "0.9"
pin-project = "0.4.5"
regex = "1.0"
serde = { version = "1.0", features=["derive"] }
serde_json = "1.0"
Expand All @@ -103,17 +100,17 @@ time = "0.1.42"
url = "2.1"

# ssl support
openssl = { version="0.10", optional = true }
rustls = { version = "0.15", optional = true }
open-ssl = { version="0.10", package="openssl", optional = true }
rust-tls = { version = "0.16", package="rustls", optional = true }

[dev-dependencies]
actix = "0.8.3"
actix-connect = "0.2.2"
actix-http-test = "0.2.4"
# actix = "0.8.3"
actix-connect = "0.3.0-alpha.1"
actix-http-test = "0.3.0-alpha.1"
rand = "0.7"
env_logger = "0.6"
serde_derive = "1.0"
tokio-timer = "0.2.8"
tokio-timer = "0.3.0-alpha.6"
brotli2 = "0.3.2"
flate2 = "1.0.2"

Expand All @@ -123,19 +120,18 @@ opt-level = 3
codegen-units = 1

[patch.crates-io]
# actix-web = { path = "." }
# actix-http = { path = "actix-http" }
# actix-http-test = { path = "test-server" }
# actix-web-codegen = { path = "actix-web-codegen" }
actix-web = { path = "." }
actix-http = { path = "actix-http" }
actix-http-test = { path = "test-server" }
actix-web-codegen = { path = "actix-web-codegen" }
# actix-web-actors = { path = "actix-web-actors" }
# actix-session = { path = "actix-session" }
# actix-files = { path = "actix-files" }
# actix-multipart = { path = "actix-multipart" }
# awc = { path = "awc" }
actix-session = { path = "actix-session" }
actix-files = { path = "actix-files" }
actix-multipart = { path = "actix-multipart" }
awc = { path = "awc" }

actix-codec = { path = "../actix-net/actix-codec" }
actix-connect = { path = "../actix-net/actix-connect" }
actix-ioframe = { path = "../actix-net/actix-ioframe" }
actix-rt = { path = "../actix-net/actix-rt" }
actix-server = { path = "../actix-net/actix-server" }
actix-server-config = { path = "../actix-net/actix-server-config" }
Expand Down
10 changes: 5 additions & 5 deletions actix-cors/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-cors"
version = "0.1.0"
version = "0.2.0-alpha.1"
authors = ["Nikolay Kim <[email protected]>"]
description = "Cross-origin resource sharing (CORS) for Actix applications."
readme = "README.md"
Expand All @@ -10,14 +10,14 @@ repository = "https://github.com/actix/actix-web.git"
documentation = "https://docs.rs/actix-cors/"
license = "MIT/Apache-2.0"
edition = "2018"
#workspace = ".."
workspace = ".."

[lib]
name = "actix_cors"
path = "src/lib.rs"

[dependencies]
actix-web = "1.0.0"
actix-service = "0.4.0"
actix-web = "2.0.0-alpha.1"
actix-service = "1.0.0-alpha.1"
derive_more = "0.15.0"
futures = "0.1.25"
futures = "0.3.1"
12 changes: 6 additions & 6 deletions actix-files/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-files"
version = "0.1.7"
version = "0.2.0-alpha.1"
authors = ["Nikolay Kim <[email protected]>"]
description = "Static files support for actix web."
readme = "README.md"
Expand All @@ -18,12 +18,12 @@ name = "actix_files"
path = "src/lib.rs"

[dependencies]
actix-web = { version = "1.0.8", default-features = false }
actix-http = "0.2.11"
actix-service = "0.4.1"
actix-web = { version = "2.0.0-alpha.1", default-features = false }
actix-http = "0.3.0-alpha.1"
actix-service = "1.0.0-alpha.1"
bitflags = "1"
bytes = "0.4"
futures = "0.1.25"
futures = "0.3.1"
derive_more = "0.15.0"
log = "0.4"
mime = "0.3"
Expand All @@ -32,4 +32,4 @@ percent-encoding = "2.1"
v_htmlescape = "0.4"

[dev-dependencies]
actix-web = { version = "1.0.8", features=["ssl"] }
actix-web = { version = "2.0.0-alpha.1", features=["openssl"] }
5 changes: 2 additions & 3 deletions actix-files/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,8 @@ impl Files {
/// Set custom directory renderer
pub fn files_listing_renderer<F>(mut self, f: F) -> Self
where
for<'r, 's> F:
Fn(&'r Directory, &'s HttpRequest) -> Result<ServiceResponse, io::Error>
+ 'static,
for<'r, 's> F: Fn(&'r Directory, &'s HttpRequest) -> Result<ServiceResponse, io::Error>
+ 'static,
{
self.renderer = Rc::new(f);
self
Expand Down
20 changes: 10 additions & 10 deletions actix-framed/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-framed"
version = "0.2.1"
version = "0.3.0-alpha.1"
authors = ["Nikolay Kim <[email protected]>"]
description = "Actix framed app server"
readme = "README.md"
Expand All @@ -20,19 +20,19 @@ name = "actix_framed"
path = "src/lib.rs"

[dependencies]
actix-codec = "0.1.2"
actix-service = "0.4.1"
actix-codec = "0.2.0-alpha.1"
actix-service = "1.0.0-alpha.1"
actix-router = "0.1.2"
actix-rt = "0.2.2"
actix-http = "0.2.7"
actix-server-config = "0.1.2"
actix-rt = "1.0.0-alpha.1"
actix-http = "0.3.0-alpha.1"
actix-server-config = "0.2.0-alpha.1"

bytes = "0.4"
futures = "0.1.25"
log = "0.4"

[dev-dependencies]
actix-server = { version = "0.6.0", features=["ssl"] }
actix-connect = { version = "0.2.0", features=["ssl"] }
actix-http-test = { version = "0.2.4", features=["ssl"] }
actix-utils = "0.4.4"
actix-server = { version = "0.8.0-alpha.1", features=["openssl"] }
actix-connect = { version = "0.3.0-alpha.1", features=["openssl"] }
actix-http-test = { version = "0.3.0-alpha.1", features=["openssl"] }
actix-utils = "0.5.0-alpha.1"
18 changes: 1 addition & 17 deletions actix-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ categories = ["network-programming", "asynchronous",
"web-programming::websocket"]
license = "MIT/Apache-2.0"
edition = "2018"

# workspace = ".."
workspace = ".."

[package.metadata.docs.rs]
features = ["openssl", "fail", "brotli", "flate2-zlib", "secure-cookies"]
Expand Down Expand Up @@ -114,18 +113,3 @@ actix-http-test = { version = "0.3.0-alpha.1", features=["openssl"] }
env_logger = "0.6"
serde_derive = "1.0"
open-ssl = { version="0.10", package="openssl" }

[patch.crates-io]
awc = { path = "../awc" }
actix-http = { path = "." }
actix-http-test = { path = "../test-server" }

actix-codec = { path = "../../actix-net/actix-codec" }
actix-connect = { path = "../../actix-net/actix-connect" }
actix-rt = { path = "../../actix-net/actix-rt" }
actix-server = { path = "../../actix-net/actix-server" }
actix-server-config = { path = "../../actix-net/actix-server-config" }
actix-service = { path = "../../actix-net/actix-service" }
actix-testing = { path = "../../actix-net/actix-testing" }
actix-threadpool = { path = "../../actix-net/actix-threadpool" }
actix-utils = { path = "../../actix-net/actix-utils" }
7 changes: 3 additions & 4 deletions actix-http/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,11 @@ where
/// Finish service configuration and create *http service* for HTTP/1 protocol.
pub fn h1<F, P, B>(self, service: F) -> H1Service<T, P, S, B, X, U>
where
B: MessageBody + 'static,
B: MessageBody,
F: IntoServiceFactory<S>,
S::Error: Into<Error> + 'static,
S::Error: Into<Error>,
S::InitError: fmt::Debug,
S::Response: Into<Response<B>> + 'static,
<S::Service as Service>::Future: 'static,
S::Response: Into<Response<B>>,
{
let cfg = ServiceConfig::new(
self.keep_alive,
Expand Down
20 changes: 10 additions & 10 deletions actix-http/src/h2/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ impl<T, S, B> Dispatcher<T, S, B>
where
T: IoStream,
S: Service<Request = Request>,
S::Error: Into<Error> + 'static,
S::Future: 'static,
S::Response: Into<Response<B>> + 'static,
B: MessageBody + 'static,
S::Error: Into<Error>,
// S::Future: 'static,
S::Response: Into<Response<B>>,
B: MessageBody,
{
pub(crate) fn new(
service: CloneableService<S>,
Expand Down Expand Up @@ -176,9 +176,9 @@ enum ServiceResponseState<F, B> {
impl<F, I, E, B> ServiceResponse<F, I, E, B>
where
F: Future<Output = Result<I, E>>,
E: Into<Error> + 'static,
I: Into<Response<B>> + 'static,
B: MessageBody + 'static,
E: Into<Error>,
I: Into<Response<B>>,
B: MessageBody,
{
fn prepare_response(
&self,
Expand Down Expand Up @@ -244,9 +244,9 @@ where
impl<F, I, E, B> Future for ServiceResponse<F, I, E, B>
where
F: Future<Output = Result<I, E>>,
E: Into<Error> + 'static,
I: Into<Response<B>> + 'static,
B: MessageBody + 'static,
E: Into<Error>,
I: Into<Response<B>>,
B: MessageBody,
{
type Output = ();

Expand Down
12 changes: 6 additions & 6 deletions actix-identity/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-identity"
version = "0.1.0"
version = "0.2.0-alpha.1"
authors = ["Nikolay Kim <[email protected]>"]
description = "Identity service for actix web framework."
readme = "README.md"
Expand All @@ -17,14 +17,14 @@ name = "actix_identity"
path = "src/lib.rs"

[dependencies]
actix-web = { version = "1.0.0", default-features = false, features = ["secure-cookies"] }
actix-service = "0.4.0"
futures = "0.1.25"
actix-web = { version = "2.0.0-alpha.1", default-features = false, features = ["secure-cookies"] }
actix-service = "1.0.0-alpha.1"
futures = "0.3.1"
serde = "1.0"
serde_json = "1.0"
time = "0.1.42"

[dev-dependencies]
actix-rt = "0.2.2"
actix-http = "0.2.3"
actix-rt = "1.0.0-alpha.1"
actix-http = "0.3.0-alpha.1"
bytes = "0.4"
Loading

0 comments on commit 3127dd4

Please sign in to comment.