Skip to main content

wtx/
lib.rs

1#![allow(unused_features, reason = "remove this once `return_type_notation` is stabilized")]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3#![cfg_attr(feature = "_bench", feature(test))]
4#![cfg_attr(feature = "nightly", feature(random, return_type_notation))]
5#![doc = include_str!("../README.md")]
6#![no_std]
7
8extern crate alloc;
9#[cfg(test)]
10extern crate self as wtx;
11#[cfg(feature = "std")]
12extern crate std;
13#[allow(unused_extern_crates, reason = "selection of features")]
14#[cfg(all(feature = "_bench", test))]
15extern crate test;
16
17#[macro_use]
18mod macros;
19
20#[cfg(feature = "asn1")]
21pub mod asn1;
22#[cfg(all(feature = "_bench", test))]
23pub(crate) mod bench;
24pub mod calendar;
25#[cfg(feature = "client-api-framework")]
26pub mod client_api_framework;
27pub mod codec;
28pub mod collections;
29#[cfg(feature = "crypto")]
30pub mod crypto;
31#[cfg(feature = "database")]
32pub mod database;
33mod error;
34pub mod executor;
35pub mod futures;
36#[cfg(feature = "grpc")]
37pub mod grpc;
38#[cfg(feature = "http")]
39pub mod http;
40#[cfg(feature = "http2")]
41pub mod http2;
42pub mod misc;
43pub mod net;
44pub mod pool;
45pub mod rng;
46pub mod sync;
47#[cfg(test)]
48mod tests;
49#[cfg(feature = "tls")]
50pub mod tls;
51#[cfg(feature = "web-socket")]
52pub mod web_socket;
53#[cfg(feature = "x509")]
54pub mod x509;
55
56pub use error::{Error, RecvError, SendError};
57#[cfg(feature = "macros")]
58pub use wtx_macros::*;
59
60pub(crate) const _AFTER_CLOSE_TIMEOUT_MS: u64 = 50;
61pub(crate) const _MAX_PAYLOAD_LEN: usize = 64 * 1024 * 1024;
62pub(crate) const _SIMD_LEN: usize = _simd! {
63  4 => 4,
64  16 => 16,
65  32 => 32,
66  64 => 64
67};
68
69/// Shortcut of [`core::result::Result<T, Error>`].
70pub type Result<T> = core::result::Result<T, Error>;