1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! nexus-async-net — async adapters for nexus-net.
//!
//! Thin async wrappers over nexus-net's synchronous protocol primitives.
//! Same zero-copy parsing, same performance — just `.await` on I/O.
//!
//! # Runtime Features
//!
//! Exactly one async runtime must be enabled (mutually exclusive):
//!
//! - **`tokio-rt`** (default) — tokio-based adapters for WebSocket and REST.
//! - **`nexus`** — nexus-async-rt-based adapters (single-threaded, pre-allocated).
//! *(Renamed from `nexus-rt` in v0.4.2.)*
//!
//! # Modules
//!
//! - [`ws`] — Async WebSocket (wraps FrameReader/FrameWriter).
//! Both backends provide `recv()`/`send_*()`. The tokio backend also
//! implements `Stream`/`Sink` for ecosystem integration.
//! - [`rest`] — Async HTTP REST client (wraps RequestWriter/ResponseReader)
//!
//! # Custom transports
//!
//! `WsStream<S>` / `HttpConnection<S>` consume a
//! [`WireStream`](nexus_net::WireStream) — the canonical `MaybeTls`
//! transport implements it directly. To plug a custom
//! `AsyncRead+AsyncWrite` transport into the same API, wrap it at
//! the call site:
//!
//! - tokio (`feature = "tokio-rt"`): [`AsyncReadAdapter`]
//! - nexus-async-rt (`feature = "nexus"`): [`NexusAsyncReadAdapter`]
//!
//! ```ignore
//! let tcp = tokio::net::TcpStream::connect(addr).await?;
//! let ws = WsStreamBuilder::new()
//! .connect_with(AsyncReadAdapter::new(tcp), url)
//! .await?;
//! ```
compile_error!;
// `maybe_tls` is implementation surface for the connection builders;
// exposed publicly only so integration tests in this crate's
// `tests/` directory can construct `TlsInner` directly (the test
// binary is a separate compilation unit).
pub use AsyncReadAdapter;
pub use NexusAsyncReadAdapter;
// Re-export nexus-net types for convenience
pub use nexus_net;