Skip to main content

Module remote_mount

Module remote_mount 

Source
Expand description

Remote model mount — bridges the VFS Mount trait to the generated ModelClient RPC.

RemoteModelMount wraps a ModelClient and translates synchronous Mount trait calls into async RPC requests over ZMQ. This allows the TUI shell’s VFS namespace to serve /srv/model by proxying 9P operations to the model service, which in turn delegates to its local FsHandler / SyntheticTree.

§Shared bridge

The sync→async plumbing (embedded tokio runtime, fid allocator, fid map, anyhow → MountError mapping, the opaque fid key, and the packed 9P stat parser) is shared with RemoteRegistryMount via NinePBridge in crate::services::ninep_bridge. Only the model-specific pieces live here: the ModelClient/ModelFsClient types, the 1-level scope extraction (first path component = model ref), and the stat (not np_stat) RPC method name.

§Fid management

The mount allocates local fid numbers and tracks them via the bridge’s DashMap. Each local fid maps to a RemoteFidState that stores the remote fid number returned by walk, plus metadata (open mode, qtype) for stat/readdir synthesis.

§Timeout / graceful degradation

A dedicated single-threaded tokio runtime drives the async client. If the model service is unreachable, block_on will hang until the ZMQ socket timeout fires (set on the underlying socket). Callers see MountError::Io("service unreachable: ...").

Structs§

RemoteModelMount
A Mount implementation that proxies 9P operations to the model service via the generated ModelClient RPC.