mirror of
https://github.com/actix/actix-web.git
synced 2024-11-29 21:11:17 +00:00
awc: Minimize futures
dependencies
This commit is contained in:
parent
24372467d9
commit
d7abbff3b0
9 changed files with 12 additions and 11 deletions
|
@ -42,7 +42,7 @@ actix-rt = "1.0.0"
|
||||||
base64 = "0.11"
|
base64 = "0.11"
|
||||||
bytes = "0.5.3"
|
bytes = "0.5.3"
|
||||||
derive_more = "0.99.2"
|
derive_more = "0.99.2"
|
||||||
futures-core = "0.3.1"
|
futures-core = { version = "0.3.5", default-features = false }
|
||||||
log =" 0.4"
|
log =" 0.4"
|
||||||
mime = "0.3"
|
mime = "0.3"
|
||||||
percent-encoding = "2.1"
|
percent-encoding = "2.1"
|
||||||
|
@ -63,6 +63,6 @@ actix-server = "1.0.0"
|
||||||
actix-tls = { version = "2.0.0-alpha.1", features = ["openssl", "rustls"] }
|
actix-tls = { version = "2.0.0-alpha.1", features = ["openssl", "rustls"] }
|
||||||
brotli2 = "0.3.2"
|
brotli2 = "0.3.2"
|
||||||
flate2 = "1.0.13"
|
flate2 = "1.0.13"
|
||||||
futures = "0.3.1"
|
futures-util = { version = "0.3.5", default-features = false }
|
||||||
env_logger = "0.7"
|
env_logger = "0.7"
|
||||||
webpki = "0.21"
|
webpki = "0.21"
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
//! An HTTP Client
|
//! An HTTP Client
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```rust
|
||||||
//! use futures::future::{lazy, Future};
|
|
||||||
//! use actix_rt::System;
|
//! use actix_rt::System;
|
||||||
//! use awc::Client;
|
//! use awc::Client;
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -156,7 +156,7 @@ impl ClientRequest {
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// fn main() {
|
/// fn main() {
|
||||||
/// # actix_rt::System::new("test").block_on(futures::future::lazy(|_| {
|
/// # actix_rt::System::new("test").block_on(futures_util::future::lazy(|_| {
|
||||||
/// let req = awc::Client::new()
|
/// let req = awc::Client::new()
|
||||||
/// .get("http://www.rust-lang.org")
|
/// .get("http://www.rust-lang.org")
|
||||||
/// .set(awc::http::header::Date::now())
|
/// .set(awc::http::header::Date::now())
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
use std::cell::{Ref, RefMut};
|
use std::cell::{Ref, RefMut};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
use std::future::Future;
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::task::{Context, Poll};
|
use std::task::{Context, Poll};
|
||||||
|
|
||||||
use bytes::{Bytes, BytesMut};
|
use bytes::{Bytes, BytesMut};
|
||||||
use futures_core::{ready, Future, Stream};
|
use futures_core::{ready, Stream};
|
||||||
|
|
||||||
use actix_http::cookie::Cookie;
|
use actix_http::cookie::Cookie;
|
||||||
use actix_http::error::{CookieParseError, PayloadError};
|
use actix_http::error::{CookieParseError, PayloadError};
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
use std::future::Future;
|
||||||
use std::net;
|
use std::net;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
@ -7,7 +8,7 @@ use std::time::Duration;
|
||||||
use actix_rt::time::{delay_for, Delay};
|
use actix_rt::time::{delay_for, Delay};
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use derive_more::From;
|
use derive_more::From;
|
||||||
use futures_core::{Future, Stream};
|
use futures_core::Stream;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use actix_http::body::{Body, BodyStream};
|
use actix_http::body::{Body, BodyStream};
|
||||||
|
|
|
@ -9,7 +9,7 @@ use bytes::Bytes;
|
||||||
use flate2::read::GzDecoder;
|
use flate2::read::GzDecoder;
|
||||||
use flate2::write::GzEncoder;
|
use flate2::write::GzEncoder;
|
||||||
use flate2::Compression;
|
use flate2::Compression;
|
||||||
use futures::future::ok;
|
use futures_util::future::ok;
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
|
|
||||||
use actix_http::HttpService;
|
use actix_http::HttpService;
|
||||||
|
|
|
@ -7,7 +7,7 @@ use actix_http_test::test_server;
|
||||||
use actix_service::{map_config, pipeline_factory, ServiceFactory};
|
use actix_service::{map_config, pipeline_factory, ServiceFactory};
|
||||||
use actix_web::http::Version;
|
use actix_web::http::Version;
|
||||||
use actix_web::{dev::AppConfig, web, App, HttpResponse};
|
use actix_web::{dev::AppConfig, web, App, HttpResponse};
|
||||||
use futures::future::ok;
|
use futures_util::future::ok;
|
||||||
use open_ssl::ssl::{SslAcceptor, SslFiletype, SslMethod, SslVerifyMode};
|
use open_ssl::ssl::{SslAcceptor, SslFiletype, SslMethod, SslVerifyMode};
|
||||||
use rust_tls::ClientConfig;
|
use rust_tls::ClientConfig;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ use actix_http_test::test_server;
|
||||||
use actix_service::{map_config, pipeline_factory, ServiceFactory};
|
use actix_service::{map_config, pipeline_factory, ServiceFactory};
|
||||||
use actix_web::http::Version;
|
use actix_web::http::Version;
|
||||||
use actix_web::{dev::AppConfig, web, App, HttpResponse};
|
use actix_web::{dev::AppConfig, web, App, HttpResponse};
|
||||||
use futures::future::ok;
|
use futures_util::future::ok;
|
||||||
use open_ssl::ssl::{SslAcceptor, SslConnector, SslFiletype, SslMethod, SslVerifyMode};
|
use open_ssl::ssl::{SslAcceptor, SslConnector, SslFiletype, SslMethod, SslVerifyMode};
|
||||||
|
|
||||||
fn ssl_acceptor() -> SslAcceptor {
|
fn ssl_acceptor() -> SslAcceptor {
|
||||||
|
|
|
@ -4,8 +4,8 @@ use actix_codec::Framed;
|
||||||
use actix_http::{body::BodySize, h1, ws, Error, HttpService, Request, Response};
|
use actix_http::{body::BodySize, h1, ws, Error, HttpService, Request, Response};
|
||||||
use actix_http_test::test_server;
|
use actix_http_test::test_server;
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use futures::future::ok;
|
use futures_util::future::ok;
|
||||||
use futures::{SinkExt, StreamExt};
|
use futures_util::{SinkExt, StreamExt};
|
||||||
|
|
||||||
async fn ws_service(req: ws::Frame) -> Result<ws::Message, io::Error> {
|
async fn ws_service(req: ws::Frame) -> Result<ws::Message, io::Error> {
|
||||||
match req {
|
match req {
|
||||||
|
|
Loading…
Reference in a new issue