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