Expand description
9P2000.L codec and server-side translator for hyprstream.
Two halves:
-
Codec (
msg): the full 9P2000.L wire format.read_from/write_tostyle helpers for both client and server sides — T-message parsers + R-message encoders live alongside the original client-side encoders + R-message parsers. -
Translator (
translator): a server that accepts 9P connections (TCP transport now; virtio-9P later), maintains a server-side fid table, and translates each T-message into abackend::Backendcall. The backend is the capnp-RPC seam: thehyprstreambinary crate ships aModelBackendthat turns each call into anine.capnpenvelope against the model service’sfsscope — the inverse ofRemoteModelMount(VFS → RPC).
§Client side
client is the transport-agnostic 9P2000.L client (client::P9Client),
driven by a client::P9Transport. Two transports back it:
- wasm ([
dma], [wanix_mount]) — SharedArrayBuffer DMA ring to a browser Wanix server; single-threaded, so [wanix_mount::WanixMount] usesunsafe impl Send/Sync. - native (
socket_transport,remote_mount) — a real Unix/TCP socket (socket_transport::SocketTransport) exposed as a genuinelySend + SyncVFSMount(remote_mount::Remote9pMount). This is the client half of #708: dial a remote 9P server and import its tree into the host namespace. It is the exact inverse ofmount_backend::MountBackend(Mount → 9P server) and shares the sameclient::P9Transport/msgwire core, so a future 9P-over-WebSocket server reuses the same seam.
The wasm WanixMount and native Remote9pMount are deliberately separate
types rather than one renamed generic: they have incompatible Send/Sync
stories (wasm’s unsafe impl is only sound single-threaded, native is
genuinely thread-safe) and are gated to disjoint targets.
Re-exports§
pub use backend::Backend;pub use backend::OpenResult;pub use backend::StatResult;pub use backend::WalkResult;pub use client::P9Client;pub use client::P9Transport;pub use mac_seam::anonymous_floor;pub use mac_seam::AccessDecider;pub use mac_seam::Action;pub use mac_seam::AnonymousAuthenticator;pub use mac_seam::AttachAuthenticator;pub use mac_seam::DenyAllDecider;pub use mac_seam::DenyUnlabeledResolver;pub use mac_seam::ReferenceMonitor;pub use mac_seam::ReferenceMonitorDenyReason;pub use mac_seam::SessionContext;pub use mac_seam::VerifiedAttach;pub use mac_seam::VerifiedAttachIdentity;pub use mac_seam::VerifiedTokenScope;pub use mount_backend::AttachAuthorizer;pub use mount_backend::MountBackend;pub use remote_mount::Remote9pMount;pub use socket_transport::SocketTransport;pub use translator::serve_mount_uds;pub use translator::serve_mount_vsock;pub use translator::serve_mount_vsock_raw;pub use translator::FidTable;pub use translator::Translator;
Modules§
- backend
- Backend trait — the capnp-RPC-shaped seam the translator dispatches to.
- client
- 9P2000.L client — sends T-messages, receives R-messages.
- mac_
seam - 9P reference-monitor contract (S2 / #568, epic #547).
- memory
- In-memory
Backendfor standalone translator tests. - mount_
backend MountBackend— aBackendthat exports an in-process VFS [Mount].- msg
- 9P2000.L message types and wire format serialization.
- remote_
mount Remote9pMount— a native VFS [Mount] backed by a socket 9P client.- socket_
transport - Socket-backed
P9Transport— a native 9P transport over a byte stream. - translator
- Server-side 9P2000.L translator.
Enums§
- Object
Ref - A reference to the object being labeled, as available to whatever calls
ObjectLabelResolver::resolve— before any object bytes are read. Mirrors the two carriers #699 actually has data for at this layer: a walked path (matchesMount::walk’s&[&str]component slice inhyprstream-vfs, without this crate depending on that crate) or a content identifier (a manifest CID / CAS hash).
Traits§
- Object
Label Resolver - The keyed seam the reference monitor (S2/#568) calls before constructing
an
ObjectCtxfor the PDP: “resolve this walked reference to its security label.” Distinct from [LabeledObject] (which answers for an object you already hold) — this answers for a reference you are about to walk.