pub trait InterfaceSeam {
// Required methods
fn fill_entropy(&mut self, bytes: &mut [u8]);
async fn inbound_sink(&mut self) -> &mut dyn FrameSink;
async fn commit_inbound(&mut self);
async fn next_outbound(&mut self) -> &[u8] ⓘ;
// Provided methods
fn interface_origin(&self) -> InterfaceOriginKind { ... }
async fn next_inbound(&mut self, frame: &[u8]) { ... }
async fn next_inbound_with_phy(
&mut self,
frame: &[u8],
_phy: PacketPhyStats,
) { ... }
fn accept_outbound_custody(&mut self) { ... }
fn complete_outbound(&mut self, _disposition: OutboundDisposition) { ... }
fn try_next_outbound(&mut self) -> Option<&[u8]> { ... }
async fn request_tunnel_synthesis(&mut self) { ... }
}Expand description
One interface’s side of the manifold boundary: inbound frames accumulate in inbound_sink and cross on commit_inbound, and next_outbound parks until the manifold has a frame for this interface to transmit. An outbound frame arrives already committed: the engine wrote it into the lane’s slot and let go in its own synchronous step before next_outbound resolves, so the returned borrow points into the lane, never into the engine, and holding it across the transmit await pins nothing.
Required Methods§
fn fill_entropy(&mut self, bytes: &mut [u8])
Sourceasync fn inbound_sink(&mut self) -> &mut dyn FrameSink
async fn inbound_sink(&mut self) -> &mut dyn FrameSink
The storage the frame being received accumulates in — the seam’s granted inbound slot, so a streaming deframer’s writes land once, already across the seam. Parks until a slot is free (backpressure: an interface that cannot grant stops reading its medium). Repeated calls before commit_inbound return the same storage with its accumulation intact, so one frame may arrive across many reads.
Sourceasync fn commit_inbound(&mut self)
async fn commit_inbound(&mut self)
Hand the manifold the frame accumulated in inbound_sink and release the storage. An empty sink commits nothing — delimiter-only keepalives die here, in one place, for every interface.
async fn next_outbound(&mut self) -> &[u8] ⓘ
Provided Methods§
fn interface_origin(&self) -> InterfaceOriginKind
Sourceasync fn next_inbound(&mut self, frame: &[u8])
async fn next_inbound(&mut self, frame: &[u8])
Hand the manifold one whole frame heard on the medium — the datagram path, derived from the sink pair. A frame past the sink’s capacity is dropped whole.
async fn next_inbound_with_phy(&mut self, frame: &[u8], _phy: PacketPhyStats)
Sourcefn accept_outbound_custody(&mut self)
fn accept_outbound_custody(&mut self)
Accept responsibility for a frame copied into the interface’s own
bounded pending storage, allowing the seam-owned slot to be reused.
This is not completion; complete_outbound
still reports the eventual disposition.
fn complete_outbound(&mut self, _disposition: OutboundDisposition)
Sourcefn try_next_outbound(&mut self) -> Option<&[u8]>
fn try_next_outbound(&mut self) -> Option<&[u8]>
A further frame already committed for this interface, if one is waiting. Never parks; the borrow contract matches next_outbound. Serve loops use it to coalesce a burst that queued behind the frame being written into one wire write; the default never offers one, so a seam without it simply never batches.
async fn request_tunnel_synthesis(&mut self)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".