Skip to main content

Crate hyprstream_9p

Crate hyprstream_9p 

Source
Expand description

9P2000.L codec and server-side translator for hyprstream.

Two halves:

  • Codec (msg): the full 9P2000.L wire format. read_from / write_to style 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 a backend::Backend call. The backend is the capnp-RPC seam: the hyprstream binary crate ships a ModelBackend that turns each call into a nine.capnp envelope against the model service’s fs scope — the inverse of RemoteModelMount (VFS → RPC).

§Client side

client is the transport-agnostic 9P2000.L client (client::P9Client), driven by a client::P9Transport. Two transports back it:

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 Backend for standalone translator tests.
mount_backend
MountBackend — a Backend that 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§

ObjectRef
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 (matches Mount::walk’s &[&str] component slice in hyprstream-vfs, without this crate depending on that crate) or a content identifier (a manifest CID / CAS hash).

Traits§

ObjectLabelResolver
The keyed seam the reference monitor (S2/#568) calls before constructing an ObjectCtx for 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.