v0.9.0-rc.24
QuicMeshConnection trait, narrow Connection surface — closes peat-mesh#167. Replaces the pub use iroh::endpoint::Connection re-export at peat_mesh::network::Connection with a narrow trait peat_mesh::network::QuicMeshConnection that names exactly the four methods peat-protocol's formation-handshake legitimately uses (open_bi, accept_bi, close_reason, remote_endpoint_id). A future iroh Connection method addition no longer widens peat-protocol's reachable API surface by default. Closes the ADR-062-Phase-2-follow-up gap the QA reviewer of peat-mesh#166 flagged: "transport-agnosticism enforced only at the import path, not the API shape."
⚠ Breaking — public re-export surface change
peat_mesh::network::Connection (= iroh::endpoint::Connection, added in rc.22) is removed. The sole prior consumer — peat-protocol's formation_handshake.rs — migrates to &dyn QuicMeshConnection in the peat consumer-side PR (peat#932, peat 0.9.0-rc.16). Any external downstream consumer that imported peat_mesh::network::Connection directly must switch to either peat_mesh::network::QuicMeshConnection (the narrow trait) or iroh::endpoint::Connection (the raw type, requires iroh as a direct dep).
Added — ADR-062 Phase 2 follow-up: narrow trait (peat-mesh#167)
peat_mesh::network::QuicMeshConnection— narrow trait abstracting the QUIC-stream + identity surface that peat-protocol'sformation_handshakeconsumes from a mesh connection. Four methods:open_bi,accept_bi,close_reason,remote_endpoint_id. Implemented foriroh::endpoint::Connection. Disambiguates from the pre-existingcrate::transport::MeshConnectiontrait (which operates onNodeId-tagged lifecycle predicates rather than QUIC streams) — theQuicprefix marks the stream-oriented half.peat_mesh::network::{SendStream, RecvStream, ConnectionError}— re-exports of the iroh types theQuicMeshConnectiontrait references in its method signatures. Lets downstream consumers name them via peat-mesh paths.
Removed
pub use iroh::endpoint::Connectionfrompeat_mesh::network— replaced by theQuicMeshConnectiontrait export. peat-protocol'sformation_handshake.rs(the sole prior consumer) migrates to&dyn QuicMeshConnectioninstead of the raw irohConnectionhandle. A future irohConnectionmethod addition (datagrams, paths, etc.) no longer widens peat-protocol's reachable API surface by default — the trait names exactly the four methods the handshake legitimately uses; adding more requires amending the trait. Closes the ADR-062-Phase-2-follow-up gap the QA reviewer of peat-mesh#166 flagged: "transport-agnosticism enforced only at the import path, not the API shape."
Compile-only pin + runtime dispatch test
network::quic_mesh_connection::tests::_connection_impls_quic_mesh_connection is a #[allow(dead_code)] fn that takes a Connection and binds it as &dyn QuicMeshConnection. A future iroh release that removes / renames any of the four delegated methods fails to compile here at peat-mesh CI rather than at a downstream peat-protocol build site. Same shape as the reexport_pin typecheck for the type re-exports.
network::quic_mesh_connection::tests::dyn_dispatch_resolves_via_async_trait is a runtime test that exercises every one of the four trait methods through a &dyn QuicMeshConnection cast against a MockConn impl with synthetic return values. Catches async_trait codegen regressions (object-safety lapses, lifetime drift on the returned Pin<Box<dyn Future + Send>>, async-fn-in-trait dispatch resolution) at runtime. Real-iroh end-to-end coverage lands cleanly via peat-protocol's formation_handshake e2e tests once the consumer-side migration ships (peat#932, peat 0.9.0-rc.16).