Skip to main content

http_type/
lib.rs

1//! A comprehensive Rust type library for HTTP operations and
2//! concurrent programming. Provides core HTTP types
3//! (Request/Response with builder patterns, Method,
4//! HttpStatus, HttpVersion, ContentType, FileExtension with
5//! MIME mapping, Cookie parsing/building, HttpUrl parsing,
6//! WebSocket frame/opcode, protocol upgrade types,
7//! stream/task management, panic handling), thread-safe
8//! concurrent wrappers (ArcMutex, ArcRwLock, BoxRwLock,
9//! RcRwLock), dynamic dispatch types (BoxAny, RcAny, ArcAny
10//! with Send/Sync variants), high-performance hash collections
11//!  (HashMapXxHash3_64, HashSetXxHash3_64), and static lifetime
12//! utilities (BoxLeak, Lifetime trait).
13
14mod any;
15mod arc_mutex;
16mod arc_rwlock;
17mod attribute;
18mod box_leak;
19mod box_rwlock;
20mod content_type;
21mod cookie;
22mod file_extension;
23mod hash_map_xx_hash3_64;
24mod hash_set_xx_hash3_64;
25mod http_status;
26mod http_url;
27mod http_version;
28mod lifetime;
29mod methods;
30mod panic;
31mod protocol;
32mod rc_rwlock;
33mod request;
34mod response;
35mod status;
36mod stream;
37mod task;
38mod upgrade_type;
39mod websocket_frame;
40
41pub use {
42    any::*, arc_mutex::*, arc_rwlock::*, attribute::*, box_leak::*, box_rwlock::*, content_type::*,
43    cookie::*, file_extension::*, hash_map_xx_hash3_64::*, hash_set_xx_hash3_64::*, http_status::*,
44    http_url::*, http_version::*, lifetime::*, methods::*, panic::*, protocol::*, rc_rwlock::*,
45    request::*, response::*, status::*, stream::*, task::*, upgrade_type::*, websocket_frame::*,
46};
47
48pub use {http_compress::*, http_constant::*, serde_json, tokio};
49
50use std::{
51    any::Any,
52    collections::{HashMap, HashSet, VecDeque},
53    fmt::{self, Debug, Display, Formatter},
54    hash::Hash,
55    io::ErrorKind,
56    net::IpAddr,
57    num::ParseIntError,
58    pin::Pin,
59    rc::Rc,
60    result::Result,
61    str::{FromStr, SplitWhitespace},
62    sync::{
63        Arc,
64        atomic::{self, AtomicBool, AtomicUsize},
65    },
66    time::Duration,
67};
68
69use {
70    core::hash::BuildHasherDefault,
71    lombok_macros::*,
72    serde::{Deserialize, Serialize, de::DeserializeOwned},
73    tokio::{
74        io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader},
75        net::TcpStream,
76        runtime::Handle,
77        sync::{
78            Mutex, Notify, RwLock, RwLockReadGuard, RwLockWriteGuard,
79            mpsc::{UnboundedReceiver, UnboundedSender, unbounded_channel},
80        },
81        task::{JoinError, LocalSet, spawn_blocking, spawn_local},
82        time::{error::Elapsed, timeout},
83    },
84    url::{ParseError, Url},
85};