tcplane 8.1.0

tcplane is a lightweight and high-performance Rust TCP server library designed to simplify network service development. It supports TCP communication, data stream management, and connection handling, focusing on providing efficient low-level network connections and data transmission capabilities, making it ideal for building modern network services.
Documentation
use crate::*;

/// Represents the inner, mutable server configuration.
///
/// This structure holds all the settings for the TCP server,
/// including network parameters and buffer sizes.
#[derive(Clone)]
pub(crate) struct ServerConfigData {
    /// The host address the server will bind to.
    pub(crate) host: String,
    /// The port number the server will listen on.
    pub(crate) port: u16,
    /// The network buffer size for read operations.
    pub(crate) buffer_size: usize,
}

/// Represents the thread-safe, shareable server configuration.
///
/// This structure wraps `ServerConfigData` in an `Arc<RwLock<ServerConfigData>>`
/// to allow for safe concurrent access and modification of the server settings.
#[derive(Clone)]
pub struct ServerConfig(pub(super) ArcRwLock<ServerConfigData>);