1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 02:19:22 +02:00

update examples

This commit is contained in:
Nikolay Kim
2018-03-30 18:54:38 -07:00
parent 9e751de707
commit 8d8f6bedad
19 changed files with 137 additions and 104 deletions

View File

@ -35,7 +35,7 @@ use httpresponse::HttpResponse;
/// # #[macro_use] extern crate serde_derive;
/// # use actix_web::*;
/// use actix_web::http::NormalizePath;
/// #
///
/// # fn index(req: HttpRequest) -> httpcodes::StaticResponse {
/// # httpcodes::HttpOk
/// # }

View File

@ -32,6 +32,15 @@ use httpresponse::HttpResponse;
/// max buffer size 64k
pub(crate) const MAX_WRITE_BUFFER_SIZE: usize = 65_536;
/// Create new http server with application factory
pub fn new<F, U, H>(factory: F) -> HttpServer<H>
where F: Fn() -> U + Sync + Send + 'static,
U: IntoIterator<Item=H> + 'static,
H: IntoHttpHandler + 'static
{
HttpServer::new(factory)
}
#[derive(Debug, PartialEq, Clone, Copy)]
/// Server keep-alive setting
pub enum KeepAlive {