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:
@ -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
|
||||
/// # }
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user