mirror of
https://github.com/fafhrd91/actix-net
synced 2024-12-03 20:52:13 +01:00
33 lines
681 B
Rust
33 lines
681 B
Rust
//! General purpose tcp server
|
|
|
|
mod accept;
|
|
mod builder;
|
|
mod config;
|
|
mod counter;
|
|
mod server;
|
|
mod services;
|
|
pub mod ssl;
|
|
mod worker;
|
|
|
|
pub use self::builder::ServerBuilder;
|
|
pub use self::config::{ServiceConfig, ServiceRuntime};
|
|
pub use self::server::Server;
|
|
pub use self::services::{ServerMessage, ServiceFactory, StreamServiceFactory};
|
|
|
|
/// 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 + 1);
|
|
self.0 += 1;
|
|
token
|
|
}
|
|
}
|
|
|
|
/// Start server building process
|
|
pub fn build() -> ServerBuilder {
|
|
ServerBuilder::default()
|
|
}
|