From cf54be2f1792593434021322fcacedf18c635106 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Thu, 23 Aug 2018 09:39:11 -0700 Subject: [PATCH] hide new server api --- CHANGES.md | 4 +++- MIGRATION.md | 2 +- src/server/http.rs | 42 +++++++----------------------------------- src/server/mod.rs | 4 ++++ src/server/server.rs | 13 ++++++++----- 5 files changed, 23 insertions(+), 42 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9dd908aeb..fcaf25545 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ # Changes -## [0.8.0] - 2018-08-xx +## [0.7.4] - 2018-08-xx ### Added @@ -15,6 +15,8 @@ ### Changed * It is allowed to use function with up to 10 parameters for handler with `extractor parameters`. + `Route::with_config()`/`Route::with_async_config()` always passes configuration objects as tuple + even for handler with one parameter. * native-tls - 0.2 diff --git a/MIGRATION.md b/MIGRATION.md index 910e99a4a..3c0bdd943 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,4 +1,4 @@ -## 0.8 +## 0.7.4 * `Route::with_config()`/`Route::with_async_config()` always passes configuration objects as tuple even for handler with one parameter. diff --git a/src/server/http.rs b/src/server/http.rs index e3740d955..f0cbacdb9 100644 --- a/src/server/http.rs +++ b/src/server/http.rs @@ -175,11 +175,11 @@ where } /// Disable `HTTP/2` support - #[doc(hidden)] - #[deprecated( - since = "0.7.4", - note = "please use acceptor service with proper ServerFlags parama" - )] + // #[doc(hidden)] + // #[deprecated( + // since = "0.7.4", + // note = "please use acceptor service with proper ServerFlags parama" + // )] pub fn no_http2(mut self) -> Self { self.no_http2 = true; self @@ -217,6 +217,7 @@ where self } + #[doc(hidden)] /// Use listener for accepting incoming connection requests pub fn listen_with(mut self, lst: net::TcpListener, acceptor: A) -> Self where @@ -234,11 +235,6 @@ where } #[cfg(feature = "tls")] - #[doc(hidden)] - #[deprecated( - since = "0.7.4", - note = "please use `actix_web::HttpServer::listen_with()` and `actix_web::server::NativeTlsAcceptor` instead" - )] /// Use listener for accepting incoming tls connection requests /// /// HttpServer does not change any configuration for TcpListener, @@ -250,11 +246,6 @@ where } #[cfg(feature = "alpn")] - #[doc(hidden)] - #[deprecated( - since = "0.7.4", - note = "please use `actix_web::HttpServer::listen_with()` and `actix_web::server::OpensslAcceptor` instead" - )] /// Use listener for accepting incoming tls connection requests /// /// This method sets alpn protocols to "h2" and "http/1.1" @@ -274,11 +265,6 @@ where } #[cfg(feature = "rust-tls")] - #[doc(hidden)] - #[deprecated( - since = "0.7.4", - note = "please use `actix_web::HttpServer::listen_with()` and `actix_web::server::RustlsAcceptor` instead" - )] /// Use listener for accepting incoming tls connection requests /// /// This method sets alpn protocols to "h2" and "http/1.1" @@ -313,6 +299,7 @@ where } /// Start listening for incoming connections with supplied acceptor. + #[doc(hidden)] #[cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))] pub fn bind_with(mut self, addr: S, acceptor: A) -> io::Result where @@ -365,11 +352,6 @@ where } #[cfg(feature = "tls")] - #[doc(hidden)] - #[deprecated( - since = "0.7.4", - note = "please use `actix_web::HttpServer::bind_with()` and `actix_web::server::NativeTlsAcceptor` instead" - )] /// The ssl socket address to bind /// /// To bind multiple addresses this method can be called multiple times. @@ -382,11 +364,6 @@ where } #[cfg(feature = "alpn")] - #[doc(hidden)] - #[deprecated( - since = "0.7.4", - note = "please use `actix_web::HttpServer::bind_with()` and `actix_web::server::OpensslAcceptor` instead" - )] /// Start listening for incoming tls connections. /// /// This method sets alpn protocols to "h2" and "http/1.1" @@ -407,11 +384,6 @@ where } #[cfg(feature = "rust-tls")] - #[doc(hidden)] - #[deprecated( - since = "0.7.4", - note = "please use `actix_web::HttpServer::bind_with()` and `actix_web::server::RustlsAcceptor` instead" - )] /// Start listening for incoming tls connections. /// /// This method sets alpn protocols to "h2" and "http/1.1" diff --git a/src/server/mod.rs b/src/server/mod.rs index cccdf8267..901260be3 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -137,11 +137,15 @@ mod worker; use actix::Message; pub use self::message::Request; + +#[doc(hidden)] pub use self::server::{ ConnectionRateTag, ConnectionTag, Connections, Server, Service, ServiceHandler, }; pub use self::settings::ServerSettings; pub use self::http::HttpServer; + +#[doc(hidden)] pub use self::ssl::*; #[doc(hidden)] diff --git a/src/server/server.rs b/src/server/server.rs index 552ba8ee2..0646c100c 100644 --- a/src/server/server.rs +++ b/src/server/server.rs @@ -13,8 +13,9 @@ use super::accept::{AcceptLoop, AcceptNotify, Command}; use super::worker::{StopWorker, Worker, WorkerClient, Conn}; use super::{PauseServer, ResumeServer, StopServer, Token}; -///Describes service that could be used -///with [Server](struct.Server.html) +#[doc(hidden)] +/// Describes service that could be used +/// with [Server](struct.Server.html) pub trait Service: Send + 'static { /// Clone service fn clone(&self) -> Box; @@ -33,8 +34,9 @@ impl Service for Box { } } -///Describes the way serivce handles incoming -///TCP connections. +#[doc(hidden)] +/// Describes the way serivce handles incoming +/// TCP connections. pub trait ServiceHandler { /// Handle incoming stream fn handle(&mut self, token: Token, io: net::TcpStream, peer: Option); @@ -47,7 +49,8 @@ pub(crate) enum ServerCommand { WorkerDied(usize), } -///Server +/// Generic server +#[doc(hidden)] pub struct Server { threads: usize, workers: Vec<(usize, Addr)>,