Skip to main content

tcplane/
lib.rs

1//! tcplane
2//!
3//! tcplane is a lightweight and high-performance Rust TCP server
4//! library designed to simplify network service development.
5//! It supports TCP communication, data stream management,
6//! and connection handling, focusing on providing efficient
7//! low-level network connections and data transmission capabilities,
8//! making it ideal for building modern network services.
9
10mod common;
11mod config;
12mod context;
13mod error;
14mod handler;
15mod middleware;
16mod request;
17mod response;
18mod server;
19mod stream;
20mod utils;
21
22pub use {
23    common::*, config::*, context::*, error::*, handler::*, middleware::*, request::*, response::*,
24    server::*, stream::*, utils::*,
25};
26
27pub use tokio;
28
29use std::{
30    any::Any,
31    collections::HashMap,
32    error::Error as StdError,
33    fmt::{self, Display},
34    future::Future,
35    net::SocketAddr,
36    pin::Pin,
37    sync::Arc,
38};
39
40use tokio::{
41    io::{AsyncReadExt, AsyncWriteExt},
42    net::{TcpListener, TcpStream},
43    spawn,
44    sync::{
45        RwLock, RwLockReadGuard, RwLockWriteGuard,
46        watch::{Sender, channel},
47    },
48    task::JoinHandle,
49};