Skip to main content

http_type/
lib.rs

1//! http-type
2//!
3//! A comprehensive Rust type library for HTTP operations and concurrent programming.
4
5mod any;
6mod arc_mutex;
7mod arc_rwlock;
8mod attribute;
9mod body;
10mod box_leak;
11mod box_rwlock;
12mod content_type;
13mod cookie;
14mod file_extension;
15mod hash_map_xx_hash3_64;
16mod hash_set_xx_hash3_64;
17mod http_status;
18mod http_url;
19mod http_version;
20mod lifetime;
21mod methods;
22mod panic;
23mod protocol;
24mod rc_rwlock;
25mod request;
26mod response;
27mod status;
28mod stream;
29mod task;
30#[cfg(test)]
31#[path = "../tests/mod.rs"]
32mod tests;
33mod upgrade_type;
34mod websocket_frame;
35
36pub use {
37    any::*, arc_mutex::*, arc_rwlock::*, attribute::*, body::*, box_leak::*, box_rwlock::*,
38    content_type::*, cookie::*, file_extension::*, hash_map_xx_hash3_64::*,
39    hash_set_xx_hash3_64::*, http_status::*, http_url::*, http_version::*, lifetime::*, methods::*,
40    panic::*, protocol::*, rc_rwlock::*, request::*, response::*, status::*, stream::*, task::*,
41    upgrade_type::*, websocket_frame::*,
42};
43
44pub use {http_compress::*, http_constant::*, serde_json, tokio};
45
46use std::{
47    any::Any,
48    cell::{RefCell, RefMut},
49    collections::{HashMap, HashSet, VecDeque, hash_map::Entry},
50    error::Error,
51    fmt::{self, Debug, Display, Formatter, Write},
52    future::{self, Future},
53    hash::Hash,
54    io::{self, ErrorKind},
55    mem,
56    net::{IpAddr, SocketAddr},
57    num::ParseIntError,
58    pin::{Pin, pin},
59    rc::Rc,
60    result::Result,
61    str::{FromStr, SplitWhitespace, from_utf8},
62    sync::{
63        Arc, OnceLock,
64        atomic::{self, AtomicBool, AtomicUsize},
65    },
66    task::{Context, Poll},
67    thread_local,
68    time::Duration,
69};
70
71use {
72    core::hash::BuildHasherDefault,
73    lombok_macros::*,
74    serde::{Deserialize, Serialize, de::DeserializeOwned},
75    tokio::{
76        io::{
77            AsyncBufRead, AsyncBufReadExt, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt,
78            ReadBuf,
79        },
80        net::TcpStream,
81        runtime::Handle,
82        sync::{
83            Mutex, Notify, RwLock, RwLockReadGuard, RwLockWriteGuard,
84            mpsc::{UnboundedReceiver, UnboundedSender, unbounded_channel},
85        },
86        task::{JoinError, LocalSet, spawn_blocking, spawn_local},
87        time::{error::Elapsed, timeout},
88    },
89    url::{ParseError, Url},
90};