feat: crate-init — module skeleton (params, wire, producer, consumer, error)

- src/{params,wire,producer,consumer,error}.rs skeletons with module
  docs per overview.md §Module Map; lib.rs crate docs + re-exports
- constants in params.rs (OP_TUNNEL_OPEN, TUNNEL_ALPN,
  TUNNEL_OPEN_SCOPE) + establishment_reason helper (delegates to
  alkcall 0.7.0's ChannelOpenError::establishment_reason)
- MAX_DATAGRAM_LEN (65535) in wire.rs (ADR-003's frame-time bound)
- async-trait dropped: skeleton confirms no trait (ADR-004)

Verified: cargo check, clippy --all-targets -D warnings (native +
wasm32), fmt --check, test, wasm32 check — all clean
This commit is contained in:
2026-09-08 06:48:13 +00:00
parent 508fc6fc28
commit 50909ab1ca
9 changed files with 138 additions and 14 deletions
+23
View File
@@ -0,0 +1,23 @@
//! Tunnel error surfaces: the crate's `TunnelError` plus the typed
//! open-error helpers consumers branch on (ADR-049 §4 surface).
//!
//! Skeleton module — filled by `tunnels/params` (codec + establishment
//! error mapping) and `tunnels/consumer-session` (session errors).
/// The crate-level error type (thiserror; AGENTS.md convention 2).
///
/// Skeleton: the codec and session variants land with
/// `tunnels/wire-codec` and `tunnels/consumer-session`.
#[derive(Debug, thiserror::Error)]
pub enum TunnelError {
/// The data-plane codec rejected an operation (UDP framing).
#[error("codec: {0}")]
Codec(String),
/// A substrate-shaped operation was attempted on the wrong
/// data plane (e.g. `send_datagram` on a stream tunnel).
#[error("wrong substrate for this operation")]
WrongSubstrate,
/// An I/O failure on the session's data plane.
#[error("io: {0}")]
Io(#[from] std::io::Error),
}