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