1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-12-02 22:12:22 +01:00
actix-net/actix-server/src/lib.rs
2020-09-13 10:12:07 +01:00

38 lines
712 B
Rust

//! General purpose TCP server.
#![deny(rust_2018_idioms)]
mod accept;
mod builder;
mod config;
mod server;
mod service;
mod signals;
mod socket;
mod worker;
pub use self::builder::ServerBuilder;
pub use self::config::{ServiceConfig, ServiceRuntime};
pub use self::server::Server;
pub use self::service::ServiceFactory;
#[doc(hidden)]
pub use self::socket::FromStream;
/// Socket ID token
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub(crate) struct Token(usize);
impl Token {
pub(crate) fn next(&mut self) -> Token {
let token = Token(self.0);
self.0 += 1;
token
}
}
/// Start server building process
pub fn new() -> ServerBuilder {
ServerBuilder::default()
}