Skip to main content

Module extension

Module extension 

Source
Expand description

VFS extension mechanism.

An extension adds a new VFS operation from outside dolang-vfs, dispatched identically whether the call is served in-process (“direct”, e.g. inside dolang-shell) or over a real RPC session (“remote”, served by dolang-vfs). Extensions do not get their own dolang_rpc::Protocol; they ride as a single request/response variant in the crate-private VFS protocol, routed to the right handler by (name, version).

Extension authors implement VfsExtension and register it with vfs_extension!. The macro links a &'static dyn ErasedVfsExtension into a linkme distributed slice, so registration only requires linking the extension crate into the binary — no explicit call site is needed, and the same registration is picked up whether the binary serves direct or remote requests (or both).

This module is deliberately self-contained: nothing in the public API (ExtGift, ExtCite, ExtGuard, ExtResource, InvalidHandle, ExtOsHandle, ExtContext) names a dolang_rpc type. Extension crates should never need to depend on dolang-rpc directly.

Macros§

vfs_extension
Links a VfsExtension’s wire codec and, when AVAILABLE, its backend handler.

Structs§

DirectContext
State backing direct (in-process) extension dispatch.
ExtCite
The same handle in a wire position that names a reference the receiver has already granted, produced by ExtGift::cite.
ExtContext
Backend-agnostic context passed to VfsExtension::handle.
ExtGift
A handle to a value registered via ExtContext::register, in a wire position that grants the peer a reference to it.
ExtGuard
A retained, typed handle acquired via ExtContext::acquire.
ExtOsHandle
A native OS handle carried as an out-of-band attachment on the wire.
ExtensionSet
VFS extension protocol versions supported by a backend.
InvalidHandle
Error returned when an ExtGift/ExtCite does not refer to a live, correctly-typed value.

Traits§

ExtResource
A value that can be registered in an extension’s opaque-object table via ExtContext::register.
VfsExtension
A named, versioned VFS extension and its request handler.