1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 08:45:10 +02:00

Rename HttpServer::start() to HttpServer::run()

This commit is contained in:
Nikolay Kim
2019-12-22 17:12:22 +04:00
parent c7f3915779
commit 6a0cd2dced
12 changed files with 27 additions and 21 deletions

View File

@ -20,7 +20,7 @@
//! web::resource("/{name}/{id}/index.html").to(index))
//! )
//! .bind("127.0.0.1:8080")?
//! .start()
//! .run()
//! .await
//! }
//! ```

View File

@ -38,21 +38,17 @@ struct Config {
///
/// Create new http server with application factory.
///
/// ```rust
/// use std::io;
/// ```rust,no_run
/// use actix_web::{web, App, HttpResponse, HttpServer};
///
/// fn main() -> io::Result<()> {
/// let sys = actix_rt::System::new("example"); // <- create Actix runtime
///
/// #[actix_rt::main]
/// async fn main() -> std::io::Result<()> {
/// HttpServer::new(
/// || App::new()
/// .service(web::resource("/").to(|| HttpResponse::Ok())))
/// .bind("127.0.0.1:59090")?
/// .start();
///
/// # actix_rt::System::current().stop();
/// sys.run()
/// .run()
/// .await
/// }
/// ```
pub struct HttpServer<F, I, S, B>
@ -557,11 +553,11 @@ where
/// async fn main() -> io::Result<()> {
/// HttpServer::new(|| App::new().service(web::resource("/").to(|| HttpResponse::Ok())))
/// .bind("127.0.0.1:0")?
/// .start()
/// .run()
/// .await
/// }
/// ```
pub fn start(self) -> Server {
pub fn run(self) -> Server {
self.builder.start()
}
}