asupersync 0.3.4

Spec-first, cancel-correct, capability-secure async runtime for Rust.
Documentation
//! Async networking primitives.
//!
//! Phase 0 exposes synchronous std::net wrappers through async-looking APIs.
//! This keeps the public surface stable while the runtime lacks a reactor.

#![allow(clippy::unused_async)]

/// ATP (Asupersync Transfer Protocol) - Self-contained data movement layer.
#[cfg(not(target_arch = "wasm32"))]
pub mod atp;
/// ATP UDP socket capability boundary.
#[cfg(not(target_arch = "wasm32"))]
#[path = "atp/udp/mod.rs"]
pub mod atp_udp;
/// DNS resolution with caching and Happy Eyeballs support.
pub mod dns;
/// Happy Eyeballs v2 (RFC 8305) concurrent dual-stack connection racing.
pub mod happy_eyeballs;
/// Native QUIC protocol core codecs and types (Tokio-free, runtime-agnostic).
pub mod quic_core;
/// Native QUIC transport state machines (TLS, recovery, streams).
#[cfg(not(target_arch = "wasm32"))]
pub mod quic_native;
/// STUN protocol for NAT traversal and ICE candidate gathering.
#[cfg(not(target_arch = "wasm32"))]
pub mod stun;
/// Native QUIC API surface (T4.1).
///
/// This module intentionally aliases the Tokio-free native QUIC stack so users
/// can enable `feature = "quic"` and import `asupersync::net::quic::*` through
/// a stable feature boundary while T4.2/T4.3 continue transport hardening.
#[cfg(all(feature = "quic", not(target_arch = "wasm32")))]
pub mod quic {
    /// Native QUIC connection type.
    pub type QuicConnection = super::quic_native::NativeQuicConnection;
    /// Native QUIC configuration type.
    pub type QuicConfig = super::quic_native::NativeQuicConnectionConfig;
    /// Native QUIC error type.
    pub type QuicError = super::quic_native::NativeQuicConnectionError;
    /// Native QUIC stream alias used for send-side operations.
    pub type SendStream = super::quic_native::QuicStream;
    /// Native QUIC stream alias used for recv-side operations.
    pub type RecvStream = super::quic_native::QuicStream;
}
mod resolve;
pub mod sys;
/// TCP networking primitives.
///
/// Browser/wasm builds keep the type surface available for API compatibility,
/// but native socket entry points fail fast with `io::ErrorKind::Unsupported`.
pub mod tcp;
mod udp;
/// Unix domain socket networking primitives (includes `UnixListener`, `UnixStream`).
#[cfg(unix)]
pub mod unix;
/// WebSocket protocol implementation (RFC 6455).
pub mod websocket;
/// MessagePort-based coordination utilities for browser worker runtimes.
pub mod worker_channel;

#[cfg(not(target_arch = "wasm32"))]
pub use atp::protocol::{
    AtpFrameCodec, Frame as AtpFrame, FrameError, FrameHeader, FrameType, ProtocolVersion,
    SessionTranscript, TranscriptHash, TranscriptHasher, VarInt, VarIntError,
};
#[cfg(not(target_arch = "wasm32"))]
pub use atp_udp::{
    ATP_UDP_DEFAULT_BATCH_SIZE, ATP_UDP_DEFAULT_MAX_PACKET_SIZE, AtpUdpPacket, AtpUdpPressure,
    AtpUdpReceivedPacket, AtpUdpRecvBatch, AtpUdpSocket, AtpUdpSocketConfig, AtpUdpSocketProfile,
    LabAtpUdpSocket, LabUdpEvent,
};
pub use happy_eyeballs::{HappyEyeballsConfig, connect as happy_eyeballs_connect};
#[cfg(all(feature = "quic", not(target_arch = "wasm32")))]
pub use quic::{
    QuicConfig, QuicConnection, QuicError, RecvStream as QuicRecvStream,
    SendStream as QuicSendStream,
};
#[cfg(not(target_arch = "wasm32"))]
pub use quic_native::{
    AckEvent, AckRange, CryptoLevel, FlowControlError, FlowCredit, KeyUpdateEvent,
    NativeQuicConnection, NativeQuicConnectionConfig, NativeQuicConnectionError, PacketNumberSpace,
    QuicConnectionState, QuicStream, QuicStreamError, QuicTlsError, QuicTlsMachine,
    QuicTransportMachine, RttEstimator, SentPacketMeta, StreamDirection, StreamId, StreamRole,
    StreamTable, StreamTableError, TransportError,
};
pub use resolve::{lookup_all, lookup_one};
#[cfg(not(target_arch = "wasm32"))]
pub use stun::{IceCandidate, IceCandidateType, StunClient, StunError, StunMessageType};
#[cfg(target_os = "windows")]
pub use sys::windows::{NamedPipeClient, NamedPipeClientOptions};
pub use tcp::listener::{Incoming, TcpListener};
pub use tcp::socket::TcpSocket;
pub use tcp::split::{OwnedReadHalf, OwnedWriteHalf, ReadHalf, ReuniteError, WriteHalf};
pub use tcp::stream::TcpStream;
pub use tcp::stream::TcpStreamBuilder;
pub use udp::{
    RecvStream, SendSink, UDP_RENDEZVOUS_MAX_ATTEMPTS, UDP_RENDEZVOUS_MAX_CANDIDATES,
    UDP_RENDEZVOUS_MAX_ID_BYTES, UDP_RENDEZVOUS_NONCE_BYTES, UdpAddressFamily,
    UdpBatchCapabilities, UdpBatchIoReport, UdpBufferConfig, UdpBufferTuneReport, UdpCapability,
    UdpEndpointObservation, UdpHairpinSupport, UdpInboundDatagram, UdpNatAssessment,
    UdpNatConfidence, UdpNatKind, UdpOutboundDatagram, UdpPlatform, UdpRecvBatch,
    UdpRendezvousCandidate, UdpRendezvousCandidateKind, UdpRendezvousCandidateSet,
    UdpRendezvousSignature, UdpRendezvousValidationError, UdpSocket, UdpSocketCapabilities,
    classify_udp_nat, validate_udp_rendezvous_candidates,
};
#[cfg(unix)]
pub use unix::{
    Incoming as UnixIncoming, OwnedReadHalf as UnixOwnedReadHalf,
    OwnedWriteHalf as UnixOwnedWriteHalf, ReadHalf as UnixReadHalf,
    ReuniteError as UnixReuniteError, UnixListener, UnixStream, WriteHalf as UnixWriteHalf,
};
pub use websocket::{
    ClientHandshake, CloseCode, Frame, FrameCodec, HandshakeError, Message, Opcode, Role as WsRole,
    ServerHandshake, ServerWebSocket, WebSocket, WebSocketAcceptor, WebSocketConfig, WebSocketRead,
    WebSocketWrite, WsAcceptError, WsConnectError, WsError, WsReuniteError, WsUrl, apply_mask,
};