1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 06:20:36 +02:00

remove wrong doc example

This commit is contained in:
Nikolay Kim
2018-09-11 11:28:13 -07:00
parent b0d120c101
commit f0554efb98
3 changed files with 14 additions and 38 deletions

View File

@ -75,23 +75,20 @@ fn main() {
// service for converting incoming TcpStream to a SslStream<TcpStream>
(move |stream| {
SslAcceptorExt::accept_async(&acceptor, stream)
.map_err(|e| println!("Openssl error: {}", e))
})
// convert closure to a `NewService`
.into_new_service()
// .and_then() combinator uses other service to convert incoming `Request` to a `Response`
// and then uses that response as an input for next service.
// in this case, on success we use `logger` service
.and_then(logger)
// next service uses two components, service state and service function
// actix-net generates `NewService` impl that creates `ServiceState` instance for each new service
// and use `service` function as `Service::call`
.and_then((service, move || {
Ok(ServiceState { num: num.clone() })
}))
SslAcceptorExt::accept_async(&acceptor, stream)
.map_err(|e| println!("Openssl error: {}", e))
})
// convert closure to a `NewService`
.into_new_service()
// .and_then() combinator uses other service to convert incoming `Request` to a
// `Response` and then uses that response as an input for next
// service. in this case, on success we use `logger` service
.and_then(logger)
// next service uses two components, service state and service function
// actix-net generates `NewService` impl that creates `ServiceState` instance
// for each new service and use `service` function as
// `Service::call`
.and_then((service, move || Ok(ServiceState { num: num.clone() })))
},
).unwrap()
.start();