mirror of
https://github.com/actix/actix-web.git
synced 2024-11-20 08:31:09 +00:00
Merge pull request #1515 from JohnTitor/minimize-futures
Minimize `futures` dependencies
This commit is contained in:
commit
74491dca59
70 changed files with 127 additions and 111 deletions
|
@ -84,7 +84,9 @@ awc = { version = "2.0.0-alpha.1", default-features = false }
|
|||
bytes = "0.5.3"
|
||||
derive_more = "0.99.2"
|
||||
encoding_rs = "0.8"
|
||||
futures = "0.3.1"
|
||||
futures-channel = { version = "0.3.5", default-features = false }
|
||||
futures-core = { version = "0.3.5", default-features = false }
|
||||
futures-util = { version = "0.3.5", default-features = false }
|
||||
fxhash = "0.2.1"
|
||||
log = "0.4"
|
||||
mime = "0.3"
|
||||
|
|
|
@ -23,7 +23,8 @@ actix-http = "2.0.0-alpha.3"
|
|||
actix-service = "1.0.1"
|
||||
bitflags = "1"
|
||||
bytes = "0.5.3"
|
||||
futures = "0.3.1"
|
||||
futures-core = { version = "0.3.5", default-features = false }
|
||||
futures-util = { version = "0.3.5", default-features = false }
|
||||
derive_more = "0.99.2"
|
||||
log = "0.4"
|
||||
mime = "0.3"
|
||||
|
|
|
@ -24,8 +24,8 @@ use actix_web::http::header::{self, DispositionType};
|
|||
use actix_web::http::Method;
|
||||
use actix_web::{web, FromRequest, HttpRequest, HttpResponse};
|
||||
use bytes::Bytes;
|
||||
use futures::future::{ok, ready, Either, FutureExt, LocalBoxFuture, Ready};
|
||||
use futures::Stream;
|
||||
use futures_core::Stream;
|
||||
use futures_util::future::{ok, ready, Either, FutureExt, LocalBoxFuture, Ready};
|
||||
use mime;
|
||||
use mime_guess::from_ext;
|
||||
use percent_encoding::{utf8_percent_encode, CONTROLS};
|
||||
|
|
|
@ -18,7 +18,7 @@ use actix_web::http::header::{
|
|||
};
|
||||
use actix_web::http::{ContentEncoding, StatusCode};
|
||||
use actix_web::{Error, HttpMessage, HttpRequest, HttpResponse, Responder};
|
||||
use futures::future::{ready, Ready};
|
||||
use futures_util::future::{ready, Ready};
|
||||
|
||||
use crate::range::HttpRange;
|
||||
use crate::ChunkedReadFile;
|
||||
|
|
|
@ -26,7 +26,7 @@ actix-rt = "1.0.0"
|
|||
actix-http = "2.0.0-alpha.3"
|
||||
|
||||
bytes = "0.5.3"
|
||||
futures = "0.3.1"
|
||||
futures-util = { version = "0.3.5", default-features = false }
|
||||
pin-project = "0.4.6"
|
||||
log = "0.4"
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ use actix_http::h1::{Codec, SendResponse};
|
|||
use actix_http::{Error, Request, Response};
|
||||
use actix_router::{Path, Router, Url};
|
||||
use actix_service::{IntoServiceFactory, Service, ServiceFactory};
|
||||
use futures::future::{ok, FutureExt, LocalBoxFuture};
|
||||
use futures_util::future::{ok, FutureExt, LocalBoxFuture};
|
||||
|
||||
use crate::helpers::{BoxedHttpNewService, BoxedHttpService, HttpNewService};
|
||||
use crate::request::FramedRequest;
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::task::{Context, Poll};
|
|||
|
||||
use actix_http::Error;
|
||||
use actix_service::{Service, ServiceFactory};
|
||||
use futures::future::{FutureExt, LocalBoxFuture};
|
||||
use futures_util::future::{FutureExt, LocalBoxFuture};
|
||||
|
||||
pub(crate) type BoxedHttpService<Req> = Box<
|
||||
dyn Service<
|
||||
|
|
|
@ -6,7 +6,7 @@ use std::task::{Context, Poll};
|
|||
use actix_codec::{AsyncRead, AsyncWrite};
|
||||
use actix_http::{http::Method, Error};
|
||||
use actix_service::{Service, ServiceFactory};
|
||||
use futures::future::{ok, FutureExt, LocalBoxFuture, Ready};
|
||||
use futures_util::future::{ok, FutureExt, LocalBoxFuture, Ready};
|
||||
use log::error;
|
||||
|
||||
use crate::app::HttpServiceFactory;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
use std::future::Future;
|
||||
use std::marker::PhantomData;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
@ -9,8 +10,7 @@ use actix_http::h1::{Codec, Message};
|
|||
use actix_http::ws::{verify_handshake, HandshakeError};
|
||||
use actix_http::{Request, Response};
|
||||
use actix_service::{Service, ServiceFactory};
|
||||
use futures::future::{err, ok, Either, Ready};
|
||||
use futures::Future;
|
||||
use futures_util::future::{err, ok, Either, Ready};
|
||||
|
||||
/// Service that verifies incoming request if it is valid websocket
|
||||
/// upgrade request. In case of error returns `HandshakeError`
|
||||
|
|
|
@ -4,7 +4,7 @@ use actix_http_test::test_server;
|
|||
use actix_service::{pipeline_factory, IntoServiceFactory, ServiceFactory};
|
||||
use actix_utils::framed::Dispatcher;
|
||||
use bytes::Bytes;
|
||||
use futures::{future, SinkExt, StreamExt};
|
||||
use futures_util::{future, SinkExt, StreamExt};
|
||||
|
||||
use actix_framed::{FramedApp, FramedRequest, FramedRoute, SendError, VerifyWebSockets};
|
||||
|
||||
|
|
|
@ -56,9 +56,9 @@ copyless = "0.1.4"
|
|||
derive_more = "0.99.2"
|
||||
either = "1.5.3"
|
||||
encoding_rs = "0.8"
|
||||
futures-core = "0.3.1"
|
||||
futures-util = "0.3.1"
|
||||
futures-channel = "0.3.1"
|
||||
futures-channel = { version = "0.3.5", default-features = false }
|
||||
futures-core = { version = "0.3.5", default-features = false }
|
||||
futures-util = { version = "0.3.5", default-features = false }
|
||||
fxhash = "0.2.1"
|
||||
h2 = "0.2.1"
|
||||
http = "0.2.0"
|
||||
|
@ -88,11 +88,10 @@ flate2 = { version = "1.0.13", optional = true }
|
|||
|
||||
[dev-dependencies]
|
||||
actix-server = "1.0.1"
|
||||
actix-connect = { version = "2.0.0-alpha.2", features=["openssl"] }
|
||||
actix-http-test = { version = "1.0.0", features=["openssl"] }
|
||||
actix-tls = { version = "2.0.0-alpha.1", features=["openssl"] }
|
||||
actix-connect = { version = "2.0.0-alpha.2", features = ["openssl"] }
|
||||
actix-http-test = { version = "1.0.0", features = ["openssl"] }
|
||||
actix-tls = { version = "2.0.0-alpha.1", features = ["openssl"] }
|
||||
criterion = "0.3"
|
||||
futures = "0.3.1"
|
||||
env_logger = "0.7"
|
||||
serde_derive = "1.0"
|
||||
open-ssl = { version="0.10", package = "openssl" }
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::{env, io};
|
|||
use actix_http::{Error, HttpService, Request, Response};
|
||||
use actix_server::Server;
|
||||
use bytes::BytesMut;
|
||||
use futures::StreamExt;
|
||||
use futures_util::StreamExt;
|
||||
use http::header::HeaderValue;
|
||||
use log::info;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ use actix_http::http::HeaderValue;
|
|||
use actix_http::{Error, HttpService, Request, Response};
|
||||
use actix_server::Server;
|
||||
use bytes::BytesMut;
|
||||
use futures::StreamExt;
|
||||
use futures_util::StreamExt;
|
||||
use log::info;
|
||||
|
||||
async fn handle_request(mut req: Request) -> Result<Response, Error> {
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::{env, io};
|
|||
|
||||
use actix_http::{HttpService, Response};
|
||||
use actix_server::Server;
|
||||
use futures::future;
|
||||
use futures_util::future;
|
||||
use http::header::HeaderValue;
|
||||
use log::info;
|
||||
|
||||
|
|
|
@ -482,7 +482,7 @@ where
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use futures::stream;
|
||||
use futures_util::stream;
|
||||
use futures_util::future::poll_fn;
|
||||
use futures_util::pin_mut;
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
use std::{fmt, io, mem, time};
|
||||
|
||||
use actix_codec::{AsyncRead, AsyncWrite, Framed};
|
||||
use bytes::{Buf, Bytes};
|
||||
use futures_util::future::{err, Either, Future, FutureExt, LocalBoxFuture, Ready};
|
||||
use futures_util::future::{err, Either, FutureExt, LocalBoxFuture, Ready};
|
||||
use h2::client::SendRequest;
|
||||
use pin_project::{pin_project, project};
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use actix_service::ServiceFactory;
|
||||
use bytes::Bytes;
|
||||
use futures::future::{self, ok};
|
||||
use futures_util::future::{self, ok};
|
||||
|
||||
use actix_http::{http, HttpService, Request, Response};
|
||||
use actix_http_test::test_server;
|
||||
|
|
|
@ -5,8 +5,8 @@ use actix_http_test::test_server;
|
|||
use actix_service::{fn_service, ServiceFactory};
|
||||
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use futures::future::{err, ok, ready};
|
||||
use futures::stream::{once, Stream, StreamExt};
|
||||
use futures_util::future::{err, ok, ready};
|
||||
use futures_util::stream::{once, Stream, StreamExt};
|
||||
use open_ssl::ssl::{AlpnError, SslAcceptor, SslFiletype, SslMethod};
|
||||
|
||||
use actix_http::error::{ErrorBadRequest, PayloadError};
|
||||
|
|
|
@ -7,8 +7,8 @@ use actix_http_test::test_server;
|
|||
use actix_service::{fn_factory_with_config, fn_service};
|
||||
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use futures::future::{self, err, ok};
|
||||
use futures::stream::{once, Stream, StreamExt};
|
||||
use futures_util::future::{self, err, ok};
|
||||
use futures_util::stream::{once, Stream, StreamExt};
|
||||
use rust_tls::{
|
||||
internal::pemfile::{certs, pkcs8_private_keys},
|
||||
NoClientAuth, ServerConfig as RustlsServerConfig,
|
||||
|
|
|
@ -6,8 +6,8 @@ use actix_http_test::test_server;
|
|||
use actix_rt::time::delay_for;
|
||||
use actix_service::fn_service;
|
||||
use bytes::Bytes;
|
||||
use futures::future::{self, err, ok, ready, FutureExt};
|
||||
use futures::stream::{once, StreamExt};
|
||||
use futures_util::future::{self, err, ok, ready, FutureExt};
|
||||
use futures_util::stream::{once, StreamExt};
|
||||
use regex::Regex;
|
||||
|
||||
use actix_http::httpmessage::HttpMessage;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use std::cell::Cell;
|
||||
use std::future::Future;
|
||||
use std::marker::PhantomData;
|
||||
use std::pin::Pin;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
@ -9,9 +10,9 @@ use actix_http_test::test_server;
|
|||
use actix_service::{fn_factory, Service};
|
||||
use actix_utils::framed::Dispatcher;
|
||||
use bytes::Bytes;
|
||||
use futures::future;
|
||||
use futures::task::{Context, Poll};
|
||||
use futures::{Future, SinkExt, StreamExt};
|
||||
use futures_util::future;
|
||||
use futures_util::task::{Context, Poll};
|
||||
use futures_util::{SinkExt, StreamExt};
|
||||
|
||||
struct WsService<T>(Arc<Mutex<(PhantomData<T>, Cell<bool>)>>);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ actix-utils = "1.0.3"
|
|||
bytes = "0.5.3"
|
||||
derive_more = "0.99.2"
|
||||
httparse = "1.3"
|
||||
futures = "0.3.1"
|
||||
futures-util = { version = "0.3.5", default-features = false }
|
||||
log = "0.4"
|
||||
mime = "0.3"
|
||||
twoway = "0.2"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Multipart payload support
|
||||
use actix_web::{dev::Payload, Error, FromRequest, HttpRequest};
|
||||
use futures::future::{ok, Ready};
|
||||
use futures_util::future::{ok, Ready};
|
||||
|
||||
use crate::server::Multipart;
|
||||
|
||||
|
@ -11,7 +11,7 @@ use crate::server::Multipart;
|
|||
/// ## Server example
|
||||
///
|
||||
/// ```rust
|
||||
/// use futures::{Stream, StreamExt};
|
||||
/// use futures_util::stream::{Stream, StreamExt};
|
||||
/// use actix_web::{web, HttpResponse, Error};
|
||||
/// use actix_multipart as mp;
|
||||
///
|
||||
|
|
|
@ -8,7 +8,7 @@ use std::task::{Context, Poll};
|
|||
use std::{cmp, fmt};
|
||||
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use futures::stream::{LocalBoxStream, Stream, StreamExt};
|
||||
use futures_util::stream::{LocalBoxStream, Stream, StreamExt};
|
||||
use httparse;
|
||||
use mime;
|
||||
|
||||
|
@ -814,7 +814,7 @@ mod tests {
|
|||
use actix_utils::mpsc;
|
||||
use actix_web::http::header::{DispositionParam, DispositionType};
|
||||
use bytes::Bytes;
|
||||
use futures::future::lazy;
|
||||
use futures_util::future::lazy;
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn test_boundary() {
|
||||
|
|
|
@ -21,9 +21,11 @@ actix-web = "3.0.0-alpha.2"
|
|||
actix-http = "2.0.0-alpha.3"
|
||||
actix-codec = "0.2.0"
|
||||
bytes = "0.5.2"
|
||||
futures = "0.3.1"
|
||||
futures-channel = { version = "0.3.5", default-features = false }
|
||||
futures-core = { version = "0.3.5", default-features = false }
|
||||
pin-project = "0.4.6"
|
||||
|
||||
[dev-dependencies]
|
||||
actix-rt = "1.0.0"
|
||||
env_logger = "0.7"
|
||||
futures-util = { version = "0.3.5", default-features = false }
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use std::collections::VecDeque;
|
||||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
|
@ -11,8 +12,8 @@ use actix::{
|
|||
};
|
||||
use actix_web::error::Error;
|
||||
use bytes::Bytes;
|
||||
use futures::channel::oneshot::Sender;
|
||||
use futures::{Future, Stream};
|
||||
use futures_channel::oneshot::Sender;
|
||||
use futures_core::Stream;
|
||||
|
||||
/// Execution context for http actors
|
||||
pub struct HttpContext<A>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
//! Websocket integration
|
||||
use std::collections::VecDeque;
|
||||
use std::future::Future;
|
||||
use std::io;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
@ -23,8 +24,8 @@ use actix_web::error::{Error, PayloadError};
|
|||
use actix_web::http::{header, Method, StatusCode};
|
||||
use actix_web::{HttpRequest, HttpResponse};
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use futures::channel::oneshot::Sender;
|
||||
use futures::{Future, Stream};
|
||||
use futures_channel::oneshot::Sender;
|
||||
use futures_core::Stream;
|
||||
|
||||
/// Do websocket handshake and start ws actor.
|
||||
pub fn start<A, T>(actor: A, req: &HttpRequest, stream: T) -> Result<HttpResponse, Error>
|
||||
|
|
|
@ -2,7 +2,7 @@ use actix::prelude::*;
|
|||
use actix_web::{test, web, App, HttpRequest};
|
||||
use actix_web_actors::*;
|
||||
use bytes::Bytes;
|
||||
use futures::{SinkExt, StreamExt};
|
||||
use futures_util::{SinkExt, StreamExt};
|
||||
|
||||
struct Ws;
|
||||
|
||||
|
|
|
@ -19,4 +19,4 @@ proc-macro2 = "^1"
|
|||
[dev-dependencies]
|
||||
actix-rt = "1.0.0"
|
||||
actix-web = "3.0.0-alpha.2"
|
||||
futures = "0.3.1"
|
||||
futures-util = { version = "0.3.5", default-features = false }
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
//! ```rust
|
||||
//! use actix_web::HttpResponse;
|
||||
//! use actix_web_codegen::get;
|
||||
//! use futures::{future, Future};
|
||||
//!
|
||||
//! #[get("/test")]
|
||||
//! async fn async_test() -> Result<HttpResponse, actix_web::Error> {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
use actix_web::{http, test, web::Path, App, HttpResponse, Responder, Error};
|
||||
use actix_web::dev::{Service, Transform, ServiceRequest, ServiceResponse};
|
||||
use actix_web_codegen::{connect, delete, get, head, options, patch, post, put, trace};
|
||||
use futures::{future, Future};
|
||||
use futures_util::future;
|
||||
use actix_web::http::header::{HeaderName, HeaderValue};
|
||||
|
||||
// Make sure that we can name function as 'config'
|
||||
|
|
|
@ -42,7 +42,7 @@ actix-rt = "1.0.0"
|
|||
base64 = "0.11"
|
||||
bytes = "0.5.3"
|
||||
derive_more = "0.99.2"
|
||||
futures-core = "0.3.1"
|
||||
futures-core = { version = "0.3.5", default-features = false }
|
||||
log =" 0.4"
|
||||
mime = "0.3"
|
||||
percent-encoding = "2.1"
|
||||
|
@ -63,6 +63,6 @@ actix-server = "1.0.0"
|
|||
actix-tls = { version = "2.0.0-alpha.1", features = ["openssl", "rustls"] }
|
||||
brotli2 = "0.3.2"
|
||||
flate2 = "1.0.13"
|
||||
futures = "0.3.1"
|
||||
futures-util = { version = "0.3.5", default-features = false }
|
||||
env_logger = "0.7"
|
||||
webpki = "0.21"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
//! An HTTP Client
|
||||
//!
|
||||
//! ```rust
|
||||
//! use futures::future::{lazy, Future};
|
||||
//! use actix_rt::System;
|
||||
//! use awc::Client;
|
||||
//!
|
||||
|
|
|
@ -156,7 +156,7 @@ impl ClientRequest {
|
|||
///
|
||||
/// ```rust
|
||||
/// 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()
|
||||
/// .get("http://www.rust-lang.org")
|
||||
/// .set(awc::http::header::Date::now())
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
use std::cell::{Ref, RefMut};
|
||||
use std::fmt;
|
||||
use std::future::Future;
|
||||
use std::marker::PhantomData;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use futures_core::{ready, Future, Stream};
|
||||
use futures_core::{ready, Stream};
|
||||
|
||||
use actix_http::cookie::Cookie;
|
||||
use actix_http::error::{CookieParseError, PayloadError};
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
use std::future::Future;
|
||||
use std::net;
|
||||
use std::pin::Pin;
|
||||
use std::rc::Rc;
|
||||
|
@ -7,7 +8,7 @@ use std::time::Duration;
|
|||
use actix_rt::time::{delay_for, Delay};
|
||||
use bytes::Bytes;
|
||||
use derive_more::From;
|
||||
use futures_core::{Future, Stream};
|
||||
use futures_core::Stream;
|
||||
use serde::Serialize;
|
||||
|
||||
use actix_http::body::{Body, BodyStream};
|
||||
|
|
|
@ -9,7 +9,7 @@ use bytes::Bytes;
|
|||
use flate2::read::GzDecoder;
|
||||
use flate2::write::GzEncoder;
|
||||
use flate2::Compression;
|
||||
use futures::future::ok;
|
||||
use futures_util::future::ok;
|
||||
use rand::Rng;
|
||||
|
||||
use actix_http::HttpService;
|
||||
|
|
|
@ -7,7 +7,7 @@ use actix_http_test::test_server;
|
|||
use actix_service::{map_config, pipeline_factory, ServiceFactory};
|
||||
use actix_web::http::Version;
|
||||
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 rust_tls::ClientConfig;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ use actix_http_test::test_server;
|
|||
use actix_service::{map_config, pipeline_factory, ServiceFactory};
|
||||
use actix_web::http::Version;
|
||||
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};
|
||||
|
||||
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_test::test_server;
|
||||
use bytes::Bytes;
|
||||
use futures::future::ok;
|
||||
use futures::{SinkExt, StreamExt};
|
||||
use futures_util::future::ok;
|
||||
use futures_util::{SinkExt, StreamExt};
|
||||
|
||||
async fn ws_service(req: ws::Frame) -> Result<ws::Message, io::Error> {
|
||||
match req {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use actix_web::{test, web, App, HttpResponse};
|
||||
use awc::Client;
|
||||
use criterion::{criterion_group, criterion_main, Criterion};
|
||||
use futures::future::join_all;
|
||||
use futures_util::future::join_all;
|
||||
|
||||
const STR: &str = "Hello World Hello World Hello World Hello World Hello World \
|
||||
Hello World Hello World Hello World Hello World Hello World \
|
||||
|
|
|
@ -10,7 +10,7 @@ use actix_service::boxed::{self, BoxServiceFactory};
|
|||
use actix_service::{
|
||||
apply, apply_fn_factory, IntoServiceFactory, ServiceFactory, Transform,
|
||||
};
|
||||
use futures::future::FutureExt;
|
||||
use futures_util::future::FutureExt;
|
||||
|
||||
use crate::app_service::{AppEntry, AppInit, AppRoutingFactory};
|
||||
use crate::config::ServiceConfig;
|
||||
|
@ -474,7 +474,7 @@ where
|
|||
mod tests {
|
||||
use actix_service::Service;
|
||||
use bytes::Bytes;
|
||||
use futures::future::{ok, err};
|
||||
use futures_util::future::{ok, err};
|
||||
|
||||
use super::*;
|
||||
use crate::http::{header, HeaderValue, Method, StatusCode};
|
||||
|
|
|
@ -9,7 +9,7 @@ use actix_http::{Extensions, Request, Response};
|
|||
use actix_router::{Path, ResourceDef, ResourceInfo, Router, Url};
|
||||
use actix_service::boxed::{self, BoxService, BoxServiceFactory};
|
||||
use actix_service::{fn_service, Service, ServiceFactory};
|
||||
use futures::future::{join_all, ok, FutureExt, LocalBoxFuture};
|
||||
use futures_util::future::{join_all, ok, FutureExt, LocalBoxFuture};
|
||||
|
||||
use crate::config::{AppConfig, AppService};
|
||||
use crate::data::{DataFactory, FnDataFactory};
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::sync::Arc;
|
|||
|
||||
use actix_http::error::{Error, ErrorInternalServerError};
|
||||
use actix_http::Extensions;
|
||||
use futures::future::{err, ok, LocalBoxFuture, Ready};
|
||||
use futures_util::future::{err, ok, LocalBoxFuture, Ready};
|
||||
|
||||
use crate::dev::Payload;
|
||||
use crate::extract::FromRequest;
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::pin::Pin;
|
|||
use std::task::{Context, Poll};
|
||||
|
||||
use actix_http::error::Error;
|
||||
use futures::future::{ok, FutureExt, LocalBoxFuture, Ready};
|
||||
use futures_util::future::{ok, FutureExt, LocalBoxFuture, Ready};
|
||||
|
||||
use crate::dev::Payload;
|
||||
use crate::request::HttpRequest;
|
||||
|
@ -50,7 +50,7 @@ pub trait FromRequest: Sized {
|
|||
/// ```rust
|
||||
/// use actix_web::{web, dev, App, Error, HttpRequest, FromRequest};
|
||||
/// use actix_web::error::ErrorBadRequest;
|
||||
/// use futures::future::{ok, err, Ready};
|
||||
/// use futures_util::future::{ok, err, Ready};
|
||||
/// use serde_derive::Deserialize;
|
||||
/// use rand;
|
||||
///
|
||||
|
@ -122,7 +122,7 @@ where
|
|||
/// ```rust
|
||||
/// use actix_web::{web, dev, App, Result, Error, HttpRequest, FromRequest};
|
||||
/// use actix_web::error::ErrorBadRequest;
|
||||
/// use futures::future::{ok, err, Ready};
|
||||
/// use futures_util::future::{ok, err, Ready};
|
||||
/// use serde_derive::Deserialize;
|
||||
/// use rand;
|
||||
///
|
||||
|
|
|
@ -6,8 +6,8 @@ use std::task::{Context, Poll};
|
|||
|
||||
use actix_http::{Error, Response};
|
||||
use actix_service::{Service, ServiceFactory};
|
||||
use futures::future::{ok, Ready};
|
||||
use futures::ready;
|
||||
use futures_util::future::{ok, Ready};
|
||||
use futures_util::ready;
|
||||
use pin_project::pin_project;
|
||||
|
||||
use crate::extract::FromRequest;
|
||||
|
|
|
@ -11,7 +11,7 @@ use actix_http::encoding::Encoder;
|
|||
use actix_http::http::header::{ContentEncoding, ACCEPT_ENCODING};
|
||||
use actix_http::Error;
|
||||
use actix_service::{Service, Transform};
|
||||
use futures::future::{ok, Ready};
|
||||
use futures_util::future::{ok, Ready};
|
||||
use pin_project::pin_project;
|
||||
|
||||
use crate::dev::BodyEncoding;
|
||||
|
@ -133,7 +133,7 @@ where
|
|||
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
let this = self.project();
|
||||
|
||||
match futures::ready!(this.fut.poll(cx)) {
|
||||
match futures_util::ready!(this.fut.poll(cx)) {
|
||||
Ok(resp) => {
|
||||
let enc = if let Some(enc) = resp.response().get_encoding() {
|
||||
enc
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
use std::task::{Context, Poll};
|
||||
|
||||
use actix_service::{Service, Transform};
|
||||
use futures::future::{ok, Either, FutureExt, LocalBoxFuture};
|
||||
use futures_util::future::{ok, Either, FutureExt, LocalBoxFuture};
|
||||
|
||||
/// `Middleware` for conditionally enables another middleware.
|
||||
/// The controlled middleware must not change the `Service` interfaces.
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::rc::Rc;
|
|||
use std::task::{Context, Poll};
|
||||
|
||||
use actix_service::{Service, Transform};
|
||||
use futures::future::{ok, FutureExt, LocalBoxFuture, Ready};
|
||||
use futures_util::future::{ok, FutureExt, LocalBoxFuture, Ready};
|
||||
|
||||
use crate::http::header::{HeaderName, HeaderValue, CONTENT_TYPE};
|
||||
use crate::http::{Error as HttpError, HeaderMap};
|
||||
|
@ -157,7 +157,7 @@ where
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use actix_service::IntoService;
|
||||
use futures::future::ok;
|
||||
use futures_util::future::ok;
|
||||
|
||||
use super::*;
|
||||
use crate::dev::ServiceRequest;
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::rc::Rc;
|
|||
use std::task::{Context, Poll};
|
||||
|
||||
use actix_service::{Service, Transform};
|
||||
use futures::future::{ok, FutureExt, LocalBoxFuture, Ready};
|
||||
use futures_util::future::{ok, FutureExt, LocalBoxFuture, Ready};
|
||||
use fxhash::FxHashMap;
|
||||
|
||||
use crate::dev::{ServiceRequest, ServiceResponse};
|
||||
|
@ -147,7 +147,7 @@ where
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use actix_service::IntoService;
|
||||
use futures::future::ok;
|
||||
use futures_util::future::ok;
|
||||
|
||||
use super::*;
|
||||
use crate::http::{header::CONTENT_TYPE, HeaderValue, StatusCode};
|
||||
|
|
|
@ -11,7 +11,7 @@ use std::task::{Context, Poll};
|
|||
|
||||
use actix_service::{Service, Transform};
|
||||
use bytes::Bytes;
|
||||
use futures::future::{ok, Ready};
|
||||
use futures_util::future::{ok, Ready};
|
||||
use log::debug;
|
||||
use regex::Regex;
|
||||
use time::OffsetDateTime;
|
||||
|
@ -216,7 +216,7 @@ where
|
|||
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
let this = self.project();
|
||||
|
||||
let res = match futures::ready!(this.fut.poll(cx)) {
|
||||
let res = match futures_util::ready!(this.fut.poll(cx)) {
|
||||
Ok(res) => res,
|
||||
Err(e) => return Poll::Ready(Err(e)),
|
||||
};
|
||||
|
@ -506,7 +506,7 @@ impl<'a> fmt::Display for FormatDisplay<'a> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use actix_service::{IntoService, Service, Transform};
|
||||
use futures::future::ok;
|
||||
use futures_util::future::ok;
|
||||
|
||||
use super::*;
|
||||
use crate::http::{header, StatusCode};
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::task::{Context, Poll};
|
|||
use actix_http::http::{PathAndQuery, Uri};
|
||||
use actix_service::{Service, Transform};
|
||||
use bytes::Bytes;
|
||||
use futures::future::{ok, Ready};
|
||||
use futures_util::future::{ok, Ready};
|
||||
use regex::Regex;
|
||||
|
||||
use crate::service::{ServiceRequest, ServiceResponse};
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::{fmt, net};
|
|||
use actix_http::http::{HeaderMap, Method, Uri, Version};
|
||||
use actix_http::{Error, Extensions, HttpMessage, Message, Payload, RequestHead};
|
||||
use actix_router::{Path, Url};
|
||||
use futures::future::{ok, Ready};
|
||||
use futures_util::future::{ok, Ready};
|
||||
use tinyvec::TinyVec;
|
||||
|
||||
use crate::config::AppConfig;
|
||||
|
|
|
@ -11,7 +11,7 @@ use actix_service::boxed::{self, BoxService, BoxServiceFactory};
|
|||
use actix_service::{
|
||||
apply, apply_fn_factory, IntoServiceFactory, Service, ServiceFactory, Transform,
|
||||
};
|
||||
use futures::future::{ok, Either, LocalBoxFuture, Ready};
|
||||
use futures_util::future::{ok, Either, LocalBoxFuture, Ready};
|
||||
|
||||
use crate::data::Data;
|
||||
use crate::dev::{insert_slash, AppService, HttpServiceFactory, ResourceDef};
|
||||
|
@ -588,7 +588,7 @@ mod tests {
|
|||
|
||||
use actix_rt::time::delay_for;
|
||||
use actix_service::Service;
|
||||
use futures::future::ok;
|
||||
use futures_util::future::ok;
|
||||
|
||||
use crate::http::{header, HeaderValue, Method, StatusCode};
|
||||
use crate::middleware::DefaultHeaders;
|
||||
|
|
|
@ -10,8 +10,8 @@ use actix_http::http::{
|
|||
};
|
||||
use actix_http::{Error, Response, ResponseBuilder};
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use futures::future::{err, ok, Either as EitherFuture, Ready};
|
||||
use futures::ready;
|
||||
use futures_util::future::{err, ok, Either as EitherFuture, Ready};
|
||||
use futures_util::ready;
|
||||
use pin_project::{pin_project, project};
|
||||
|
||||
use crate::request::HttpRequest;
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::task::{Context, Poll};
|
|||
|
||||
use actix_http::{http::Method, Error};
|
||||
use actix_service::{Service, ServiceFactory};
|
||||
use futures::future::{ready, FutureExt, LocalBoxFuture};
|
||||
use futures_util::future::{ready, FutureExt, LocalBoxFuture};
|
||||
|
||||
use crate::extract::FromRequest;
|
||||
use crate::guard::{self, Guard};
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
use std::cell::RefCell;
|
||||
use std::fmt;
|
||||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::rc::Rc;
|
||||
use std::task::{Context, Poll};
|
||||
|
@ -10,7 +11,7 @@ use actix_service::boxed::{self, BoxService, BoxServiceFactory};
|
|||
use actix_service::{
|
||||
apply, apply_fn_factory, IntoServiceFactory, Service, ServiceFactory, Transform,
|
||||
};
|
||||
use futures::future::{ok, Either, Future, LocalBoxFuture, Ready};
|
||||
use futures_util::future::{ok, Either, LocalBoxFuture, Ready};
|
||||
|
||||
use crate::config::ServiceConfig;
|
||||
use crate::data::Data;
|
||||
|
@ -666,7 +667,7 @@ impl ServiceFactory for ScopeEndpoint {
|
|||
mod tests {
|
||||
use actix_service::Service;
|
||||
use bytes::Bytes;
|
||||
use futures::future::ok;
|
||||
use futures_util::future::ok;
|
||||
|
||||
use crate::dev::{Body, ResponseBody};
|
||||
use crate::http::{header, HeaderValue, Method, StatusCode};
|
||||
|
|
|
@ -13,7 +13,7 @@ use actix_http::Protocol;
|
|||
#[cfg(unix)]
|
||||
use actix_service::pipeline_factory;
|
||||
#[cfg(unix)]
|
||||
use futures::future::ok;
|
||||
use futures_util::future::ok;
|
||||
|
||||
#[cfg(feature = "openssl")]
|
||||
use actix_tls::openssl::{AlpnError, SslAcceptor, SslAcceptorBuilder};
|
||||
|
|
|
@ -536,7 +536,7 @@ mod tests {
|
|||
use crate::test::{init_service, TestRequest};
|
||||
use crate::{guard, http, web, App, HttpResponse};
|
||||
use actix_service::Service;
|
||||
use futures::future::ok;
|
||||
use futures_util::future::ok;
|
||||
|
||||
#[test]
|
||||
fn test_service_request() {
|
||||
|
|
|
@ -18,8 +18,9 @@ use actix_service::{
|
|||
use awc::error::PayloadError;
|
||||
use awc::{Client, ClientRequest, ClientResponse, Connector};
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use futures::future::ok;
|
||||
use futures::stream::{Stream, StreamExt};
|
||||
use futures_core::Stream;
|
||||
use futures_util::future::ok;
|
||||
use futures_util::StreamExt;
|
||||
use net2::TcpBuilder;
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde::Serialize;
|
||||
|
|
|
@ -9,8 +9,8 @@ use std::{fmt, ops};
|
|||
use actix_http::{Error, HttpMessage, Payload, Response};
|
||||
use bytes::BytesMut;
|
||||
use encoding_rs::{Encoding, UTF_8};
|
||||
use futures::future::{err, ok, FutureExt, LocalBoxFuture, Ready};
|
||||
use futures::StreamExt;
|
||||
use futures_util::future::{err, ok, FutureExt, LocalBoxFuture, Ready};
|
||||
use futures_util::StreamExt;
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde::Serialize;
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ use std::task::{Context, Poll};
|
|||
use std::{fmt, ops};
|
||||
|
||||
use bytes::BytesMut;
|
||||
use futures::future::{err, ok, FutureExt, LocalBoxFuture, Ready};
|
||||
use futures::StreamExt;
|
||||
use futures_util::future::{err, ok, FutureExt, LocalBoxFuture, Ready};
|
||||
use futures_util::StreamExt;
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde::Serialize;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::{fmt, ops};
|
|||
|
||||
use actix_http::error::{Error, ErrorNotFound};
|
||||
use actix_router::PathDeserializer;
|
||||
use futures::future::{ready, Ready};
|
||||
use futures_util::future::{ready, Ready};
|
||||
use serde::de;
|
||||
|
||||
use crate::dev::Payload;
|
||||
|
|
|
@ -8,8 +8,9 @@ use actix_http::error::{Error, ErrorBadRequest, PayloadError};
|
|||
use actix_http::HttpMessage;
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use encoding_rs::UTF_8;
|
||||
use futures::future::{err, ok, Either, FutureExt, LocalBoxFuture, Ready};
|
||||
use futures::{Stream, StreamExt};
|
||||
use futures_core::stream::Stream;
|
||||
use futures_util::future::{err, ok, Either, FutureExt, LocalBoxFuture, Ready};
|
||||
use futures_util::StreamExt;
|
||||
use mime::Mime;
|
||||
|
||||
use crate::dev;
|
||||
|
@ -22,9 +23,10 @@ use crate::request::HttpRequest;
|
|||
/// ## Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use futures::{Future, Stream, StreamExt};
|
||||
/// use actix_web::{web, error, App, Error, HttpResponse};
|
||||
///
|
||||
/// use std::future::Future;
|
||||
/// use futures_core::stream::Stream;
|
||||
/// use futures_util::StreamExt;
|
||||
/// /// extract binary data from request
|
||||
/// async fn index(mut body: web::Payload) -> Result<HttpResponse, Error>
|
||||
/// {
|
||||
|
@ -70,8 +72,10 @@ impl Stream for Payload {
|
|||
/// ## Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use futures::{Future, Stream, StreamExt};
|
||||
/// use actix_web::{web, error, App, Error, HttpResponse};
|
||||
/// use std::future::Future;
|
||||
/// use futures_core::stream::Stream;
|
||||
/// use futures_util::StreamExt;
|
||||
///
|
||||
/// /// extract binary data from request
|
||||
/// async fn index(mut body: web::Payload) -> Result<HttpResponse, Error>
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::sync::Arc;
|
|||
use std::{fmt, ops};
|
||||
|
||||
use actix_http::error::Error;
|
||||
use futures::future::{err, ok, Ready};
|
||||
use futures_util::future::{err, ok, Ready};
|
||||
use serde::de;
|
||||
|
||||
use crate::dev::Payload;
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::task::{Context, Poll};
|
|||
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use encoding_rs::{Encoding, UTF_8};
|
||||
use futures::Stream;
|
||||
use futures_util::stream::Stream;
|
||||
|
||||
use crate::dev::Payload;
|
||||
use crate::error::{PayloadError, ReadlinesError};
|
||||
|
@ -172,7 +172,7 @@ where
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use futures::stream::StreamExt;
|
||||
use futures_util::stream::StreamExt;
|
||||
|
||||
use super::*;
|
||||
use crate::test::TestRequest;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
//! Essentials helper functions and types for application registration.
|
||||
use actix_http::http::Method;
|
||||
use actix_router::IntoPattern;
|
||||
use futures::Future;
|
||||
use std::future::Future;
|
||||
|
||||
pub use actix_http::Response as HttpResponse;
|
||||
pub use bytes::{Bytes, BytesMut};
|
||||
pub use futures::channel::oneshot::Canceled;
|
||||
pub use futures_channel::oneshot::Canceled;
|
||||
|
||||
use crate::error::BlockingError;
|
||||
use crate::extract::FromRequest;
|
||||
|
|
|
@ -41,7 +41,7 @@ awc = "2.0.0-alpha.1"
|
|||
|
||||
base64 = "0.11"
|
||||
bytes = "0.5.3"
|
||||
futures = "0.3.1"
|
||||
futures-core = { version = "0.3.5", default-features = false }
|
||||
http = "0.2.0"
|
||||
log = "0.4"
|
||||
env_logger = "0.6"
|
||||
|
|
|
@ -7,7 +7,7 @@ use actix_rt::{net::TcpStream, System};
|
|||
use actix_server::{Server, ServiceFactory};
|
||||
use awc::{error::PayloadError, ws, Client, ClientRequest, ClientResponse, Connector};
|
||||
use bytes::Bytes;
|
||||
use futures::Stream;
|
||||
use futures_core::stream::Stream;
|
||||
use http::Method;
|
||||
use net2::TcpBuilder;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
use std::future::Future;
|
||||
use std::io::{Read, Write};
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
@ -11,7 +12,7 @@ use bytes::Bytes;
|
|||
use flate2::read::GzDecoder;
|
||||
use flate2::write::{GzEncoder, ZlibDecoder, ZlibEncoder};
|
||||
use flate2::Compression;
|
||||
use futures::{ready, Future};
|
||||
use futures_util::ready;
|
||||
use rand::{distributions::Alphanumeric, Rng};
|
||||
|
||||
use actix_web::dev::BodyEncoding;
|
||||
|
@ -56,7 +57,7 @@ impl TestBody {
|
|||
}
|
||||
}
|
||||
|
||||
impl futures::Stream for TestBody {
|
||||
impl futures_core::stream::Stream for TestBody {
|
||||
type Item = Result<Bytes, Error>;
|
||||
|
||||
fn poll_next(
|
||||
|
|
Loading…
Reference in a new issue