networkframework-rs
Safe Rust bindings for Apple's Network.framework, backed by a Swift bridge plus an opt-in raw FFI surface.
What's new in v0.9
SwiftPMbridge modeled after thescreencapturekit-rslayout.- Safe modules for the requested logical areas:
Connection,Listener,Browser,Parameters,Endpoint,Path,Framer,Group,Protocol,ContentContext,Resolver,Quic,PrivacyContext,ProxyConfig, andAdvertiseDescriptor. raw-ffifeature for direct access to the low-level bridge symbols.COVERAGE.md, per-area smoke tests, and runnable examples for every area.
Crate layout
- Safe API: enabled by default.
- Raw bridge API:
--features raw-ffi - Coverage report:
COVERAGE.md
Quick start
use ;
let listener = bind?;
let port = listener.local_port;
let server = spawn;
let client = connect?;
client.send?;
let reply = client.receive?;
assert_eq!;
server.join.expect?;
# Ok::
Availability notes
Some Apple APIs are runtime-gated by the operating system:
- Application-service browsing / advertising / parameters: macOS 13+
- Relay and Oblivious HTTP proxy configuration: macOS 14+
- Ultra-constrained path / parameter flags and link quality: newer SDK/runtime combinations
The safe wrappers return NetworkError::InvalidArgument when a requested API is unavailable at runtime.
Examples
Validation
for; do ; done