1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-26 19:41:12 +00:00

Re-export actix dependency. Closes #260 (#264)

- Re-export actix's prelude into actix namespace
- Removing implicit dependency on root's actix module
This commit is contained in:
Douman 2018-05-31 20:43:14 +03:00 committed by GitHub
parent 77becb9bc0
commit 80965d7a9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 50 additions and 34 deletions

View file

@ -1,12 +1,14 @@
extern crate actix;
use std::collections::{HashMap, VecDeque};
use std::net::Shutdown;
use std::time::{Duration, Instant};
use std::{fmt, io, mem, time};
use actix::actors::{Connect as ResolveConnect, Connector, ConnectorError};
use actix::fut::WrapFuture;
use actix::registry::SystemService;
use actix::{
use self::actix::actors::{Connect as ResolveConnect, Connector, ConnectorError};
use self::actix::fut::WrapFuture;
use self::actix::registry::SystemService;
use self::actix::{
fut, Actor, ActorFuture, ActorResponse, AsyncContext, Context, ContextFutureSpawner,
Handler, Message, Recipient, StreamHandler, Supervised,
};

View file

@ -1,7 +1,6 @@
//! Http client api
//!
//! ```rust
//! # extern crate actix;
//! # extern crate actix_web;
//! # extern crate futures;
//! # extern crate tokio;
@ -63,7 +62,6 @@ impl ResponseError for SendRequestError {
///
///
/// ```rust
/// # extern crate actix;
/// # extern crate actix_web;
/// # extern crate futures;
/// # extern crate tokio;

View file

@ -1,3 +1,5 @@
extern crate actix;
use bytes::{Bytes, BytesMut};
use futures::sync::oneshot;
use futures::{Async, Future, Poll};
@ -6,7 +8,7 @@ use std::time::{Duration, Instant};
use std::{io, mem};
use tokio_timer::Delay;
use actix::prelude::*;
use self::actix::prelude::*;
use super::{
ClientBody, ClientBodyStream, ClientConnector, ClientConnectorError, ClientRequest,

View file

@ -25,7 +25,6 @@ use httprequest::HttpRequest;
/// An HTTP Client Request
///
/// ```rust
/// # extern crate actix;
/// # extern crate actix_web;
/// # extern crate futures;
/// # extern crate tokio;

View file

@ -1,12 +1,14 @@
extern crate actix;
use futures::sync::oneshot;
use futures::sync::oneshot::Sender;
use futures::{Async, Future, Poll};
use smallvec::SmallVec;
use std::marker::PhantomData;
use actix::dev::{ContextImpl, Envelope, ToEnvelope};
use actix::fut::ActorFuture;
use actix::{
use self::actix::dev::{ContextImpl, Envelope, ToEnvelope};
use self::actix::fut::ActorFuture;
use self::actix::{
Actor, ActorContext, ActorState, Addr, AsyncContext, Handler, Message, SpawnHandle,
};

View file

@ -229,8 +229,8 @@ pub trait HttpMessage {
/// # extern crate env_logger;
/// # extern crate futures;
/// # use std::str;
/// # use actix::*;
/// # use actix_web::*;
/// # use actix::*;
/// # use futures::{Future, Stream};
/// # use futures::future::{ok, result, Either};
/// fn index(mut req: HttpRequest) -> Box<Future<Item=HttpResponse, Error=Error>> {

View file

@ -132,7 +132,7 @@ extern crate serde_json;
extern crate serde_urlencoded;
extern crate smallvec;
#[macro_use]
extern crate actix;
pub extern crate actix as actix_inner;
#[cfg(test)]
#[macro_use]
@ -195,6 +195,12 @@ pub use httpresponse::HttpResponse;
pub use json::Json;
pub use scope::Scope;
pub mod actix {
//! Re-exports [actix's](https://docs.rs/actix) prelude
pub use actix_inner::prelude::*;
}
#[doc(hidden)]
#[deprecated(since = "0.6.2", note = "please use `use actix_web::ws::WsWriter`")]
pub use ws::WsWriter;

View file

@ -143,7 +143,6 @@ pub trait IdentityPolicy<S>: Sized + 'static {
/// Request identity middleware
///
/// ```rust
/// # extern crate actix;
/// # extern crate actix_web;
/// use actix_web::App;
/// use actix_web::middleware::identity::{IdentityService, CookieIdentityPolicy};

View file

@ -229,7 +229,6 @@ unsafe impl Sync for SessionImplCell {}
/// Session storage middleware
///
/// ```rust
/// # extern crate actix;
/// # extern crate actix_web;
/// use actix_web::App;
/// use actix_web::middleware::session::{SessionStorage, CookieSessionBackend};

View file

@ -1,8 +1,9 @@
//! Http server
extern crate actix;
use std::net::Shutdown;
use std::{io, time};
use actix;
use bytes::BytesMut;
use futures::{Async, Poll};
use tokio_io::{AsyncRead, AsyncWrite};
@ -42,9 +43,8 @@ pub(crate) const MAX_WRITE_BUFFER_SIZE: usize = 65_536;
/// This is shortcut for `server::HttpServer::new()` method.
///
/// ```rust
/// # extern crate actix;
/// # extern crate actix_web;
/// use actix::*;
/// use actix_web::actix::*;
/// use actix_web::{server, App, HttpResponse};
///
/// fn main() {

View file

@ -1,10 +1,12 @@
extern crate actix;
use std::rc::Rc;
use std::sync::{mpsc as sync_mpsc, Arc};
use std::time::Duration;
use std::{io, net, thread};
use actix::actors::signal;
use actix::prelude::*;
use self::actix::actors::signal;
use self::actix::prelude::*;
use futures::sync::mpsc;
use futures::{Future, Sink, Stream};
use mio;
@ -19,7 +21,7 @@ use native_tls::TlsAcceptor;
#[cfg(feature = "alpn")]
use openssl::ssl::{AlpnError, SslAcceptorBuilder};
use super::channel::{HttpChannel, WrapperStream};
use super::channel::{WrapperStream};
use super::settings::{ServerSettings, WorkerSettings};
use super::worker::{Conn, SocketInfo, StopWorker, StreamHandlerType, Worker};
use super::{IntoHttpHandler, IoStream, KeepAlive};
@ -405,8 +407,8 @@ impl<H: IntoHttpHandler> HttpServer<H> {
/// This method requires to run within properly configured `Actix` system.
///
/// ```rust
/// extern crate actix;
/// extern crate actix_web;
/// extern crate actix;
/// use actix_web::{server, App, HttpResponse};
///
/// fn main() {
@ -478,7 +480,6 @@ impl<H: IntoHttpHandler> HttpServer<H> {
///
/// ```rust,ignore
/// # extern crate futures;
/// # extern crate actix;
/// # extern crate actix_web;
/// # use futures::Future;
/// use actix_web::*;

View file

@ -1,3 +1,5 @@
extern crate actix;
use futures::sync::oneshot;
use futures::Future;
use net2::TcpStreamExt;
@ -21,8 +23,8 @@ use openssl::ssl::SslAcceptor;
#[cfg(feature = "alpn")]
use tokio_openssl::SslAcceptorExt;
use actix::msgs::StopArbiter;
use actix::*;
use self::actix::msgs::StopArbiter;
use self::actix::*;
use server::channel::HttpChannel;
use server::settings::WorkerSettings;

View file

@ -1,11 +1,13 @@
//! Various helpers for Actix applications to use during testing.
extern crate actix;
use std::rc::Rc;
use std::str::FromStr;
use std::sync::mpsc;
use std::{net, thread};
use actix::{msgs, Actor, Addr, Arbiter, System};
use self::actix::{msgs, Actor, Addr, Arbiter, System};
use cookie::Cookie;
use futures::Future;
use http::header::HeaderName;
@ -40,7 +42,6 @@ use ws;
/// # Examples
///
/// ```rust
/// # extern crate actix;
/// # extern crate actix_web;
/// # use actix_web::*;
/// #

View file

@ -1,4 +1,6 @@
//! Http client request
extern crate actix;
use std::cell::UnsafeCell;
use std::rc::Rc;
use std::time::Duration;
@ -14,7 +16,7 @@ use http::{Error as HttpError, HttpTryFrom, StatusCode};
use rand;
use sha1::Sha1;
use actix::prelude::*;
use self::actix::prelude::*;
use body::Binary;
use error::{Error, UrlParseError};

View file

@ -1,10 +1,12 @@
extern crate actix;
use futures::sync::oneshot::{self, Sender};
use futures::{Async, Poll};
use smallvec::SmallVec;
use actix::dev::{ContextImpl, Envelope, ToEnvelope};
use actix::fut::ActorFuture;
use actix::{
use self::actix::dev::{ContextImpl, Envelope, ToEnvelope};
use self::actix::fut::ActorFuture;
use self::actix::{
Actor, ActorContext, ActorState, Addr, AsyncContext, Handler, Message, SpawnHandle,
};

View file

@ -7,9 +7,8 @@
//! ## Example
//!
//! ```rust
//! # extern crate actix;
//! # extern crate actix_web;
//! # use actix::*;
//! # use actix_web::actix::*;
//! # use actix_web::*;
//! use actix_web::{ws, HttpRequest, HttpResponse};
//!
@ -43,11 +42,13 @@
//! # .finish();
//! # }
//! ```
extern crate actix;
use bytes::Bytes;
use futures::{Async, Poll, Stream};
use http::{header, Method, StatusCode};
use actix::{Actor, AsyncContext, StreamHandler};
use self::actix::{Actor, AsyncContext, StreamHandler};
use body::Binary;
use error::{Error, PayloadError, ResponseError};