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

move and update server+tls examples (#190)

This commit is contained in:
Rob Ede
2020-09-13 10:12:07 +01:00
committed by GitHub
parent 681eeb497d
commit fb0aa02b3c
14 changed files with 241 additions and 217 deletions

View File

@ -1,6 +1,6 @@
//! General purpose tcp server
#![deny(rust_2018_idioms, warnings)]
#![allow(clippy::type_complexity)]
//! General purpose TCP server.
#![deny(rust_2018_idioms)]
mod accept;
mod builder;
@ -19,7 +19,7 @@ pub use self::service::ServiceFactory;
#[doc(hidden)]
pub use self::socket::FromStream;
/// Socket id token
/// Socket ID token
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub(crate) struct Token(usize);

View File

@ -17,8 +17,10 @@ use crate::socket::{FromStream, StdStream};
pub(crate) enum ServerMessage {
/// New stream
Connect(StdStream),
/// Gracefull shutdown
/// Gracefully shutdown
Shutdown(Duration),
/// Force shutdown
ForceShutdown,
}

View File

@ -303,6 +303,7 @@ enum WorkerState {
Restarting(
usize,
Token,
#[allow(clippy::type_complexity)]
Pin<Box<dyn Future<Output = Result<Vec<(Token, BoxedServerService)>, ()>>>>,
),
Shutdown(