Expand description
Native injected mounts for a per-sandbox VFS namespace (FS-D, #365).
FS-C built the injected mounts (/stream, models, deltas) as wasm-only
Mount impls (e.g. hyprstream-rpc-std’s stream_mount.rs, gated
#![cfg(target_arch = "wasm32")]). Those rely on unsafe impl Send/Sync
over RefCell because the browser side is single-threaded. They cannot be
served to a Cloud Hypervisor guest: FS-A’s hyprstream-vfs-server runs the
down-adapter on real OS threads and requires genuinely Send + Sync mounts.
This module is the native port of those injected mounts:
SyntheticMount— a read-only synthetic file tree built from in-memory directory/file nodes. The native counterpart of the wasmSyntheticTree, used for the models / deltas listings injected into the sandbox (e.g./models/<id>/info,/deltas/<id>/meta). Read-only by construction: a plainMount(not anFsMount), so the down-adapter treats writes asEROFS— fail-closed.StreamMount— the native/streampipe mount. Streams appear as/stream/{topic}/{data,info,ctl};datayields queued blocks (EOF on an empty read),infois JSON metadata,ctlacceptscancel. The registry (StreamRegistry) isMutex-guarded — genuinelySend + Sync, no wasmunsafe impl. The block source is decoupled behindStreamRegistry’spush/completeAPI so the worker runtime can feed it from any transport.
Every op threads the caller Subject — the same uniform Subject-per-call
boundary the rest of the VFS enforces. A sandbox’s injected mounts live in
that sandbox’s forked Namespace only, so tenant
isolation is structural (#365): there is no shared registry across sandboxes
unless the caller deliberately clones the Arc.
Structs§
- Stream
Mount - Native
/streammount: streaming data pipes as a 9P-shaped tree. - Stream
Registry - Registry of active streams for a single sandbox’s
/streammount. - Synthetic
Mount - A read-only synthetic filesystem mount (native).
Enums§
- Synthetic
Node - A node in a
SyntheticMounttree: either a directory of named children or a file with fixed byte contents.