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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::*;

/// A type alias for a handler function.
///
/// This type represents a boxed async function that processes a context.
pub type HandlerFunc =
    Box<dyn Fn(Context) -> Pin<Box<dyn Future<Output = ()> + Send + 'static>> + Send + Sync>;

/// A type alias for a list of handler functions.
pub type HandlerList = Vec<HandlerFunc>;

/// A type alias for an arc-wrapped list of handlers.
pub type HandlerListArc = Arc<HandlerList>;

/// A type alias for a RwLock-wrapped arc of handler list.
pub type HandlerListArcLock = ArcRwLock<HandlerList>;