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