Skip to main content

Module net

Module net 

Source
Expand description

Net — the cross-target relay-backed network handle the interpreter holds.

One API, two transports selected at compile time: native dials with the async crate::relay::RelayClient; the browser dials with the callback-based crate::relay_browser::RelayBrowserClient. Both speak the same RelayFrame protocol to the same relay, so the interpreter’s Sync/Connect lowering is written once and runs on both targets. This is the platform-capability seam for networking, the analogue of get_platform_vfs() for files.

Events are drained, not awaited: the interpreter’s Sync is a sync point (publish local state, then merge whatever has arrived) — Net::drain returns the pending messages without blocking, which keeps the tree-walker’s linear execution model intact (no background task mutating the environment).

Structs§

Net
Native relay handle (async tokio-tungstenite client).