Expand description
Portable application contracts, operations, options, and extension workflows. Portable synchronous vectorized filesystem API.
Implement Vfsi for native vector execution; VfsiExt is blanket
implemented and composes scalar conveniences and workflows from those vectors.
This module has no backend, native RPC, or runtime dependencies.
Application read/write operations live here rather than sharing the legacy backend operation types at the crate root.
Modules§
- prelude
- Common imports for backend-independent application code.
Structs§
- Attributes
- A bitflags set of requested attributes.
- Attrs
- Idiomatic metadata returned by the Rust-native path API.
- Attrs
Options - Select metadata fields and whether to follow the final symlink. Ancestor symlinks use ordinary backend path-resolution semantics.
- Capabilities
- Typed backend capabilities. Unlike the legacy integer constants, this rejects accidental mixing with unrelated bit fields.
- Copy
Option - Options for whole-file copies through
crate::api::Vfsi::vcopy. Source final symlinks are followed by default; ancestor symlinks use normal namespace resolution. This is not a snapshot. When preserving a source symlink, its link text is copied and an existing destination is not replaced. Destination symlinks for data copies retain normal following behavior. - Depth
Limit - Compact traversal depth: 0 through 200 are finite, larger inputs are unlimited.
The root has depth zero. Unlimited depth does not disable entry/byte budgets.
Both this type and
Option<DepthLimit>occupy one byte. - DirEntry
- One native directory entry with its already-fetched metadata.
- Directory
Listing - One directory and its entries, with attributes fetched during enumeration.
- Filesystem
Stats - Filesystem capacity and limits for the filesystem containing a target.
Values are observations, not reservations.
Nonemeans unknown or unsupported. Byte counts use the filesystem allocation unit, not its preferred I/O size. - List
DirOptions - Shared directory traversal policy for collection and paged visiting. Defaults to immediate children only. Collection retains native batching; visiting delivers owned directory pages incrementally through callbacks. Unspecified budgets inherit the client’s resource limits.
- MkDirOp
- One directory creation with explicit Unix permission bits.
Construction performs no I/O and can borrow the path without allocating.
Parents must exist; submit independent siblings together with
super::Vfsi::vmkdir. - Open
Flags - Typed file-open behavior for the Rust-native API.
- OpenOp
- One complete open request. This replaces three error-prone parallel slices of paths, flags, and modes.
- Open
Options std::fs::OpenOptions-style builder for anyVfsiclient.- Permissions
- Rust-native permission bits, independent of protocol wire attributes.
- Read
Into Result - Application result for one read into caller storage, in request order.
- ReadOp
- One consuming read operation. Construction performs no I/O or allocation.
Caller buffers are borrowed only until
Vfsi::vreadreturns, including on errors. - Read
Options - Aggregate logical byte budget, defaulting to the client’s policy (16 MiB). Range request lengths must fit even if EOF returns fewer bytes. Complete files share the remaining returned-data budget and fail rather than truncate.
- Read
Result - Progress for one operation, with no borrowed references to caller storage.
- Remove
Options - Options controlling recursive removal.
- Resource
Limits - Default resource policy for a client. Per-call options override it. Byte limits bound logical payload, not allocator capacity or RPC overhead.
- SetAttrs
Op - One attribute update for a path or opened object.
- Stream
Options - Tuning options for bounded single-file streaming reads.
- Walk
Event - Root is depth zero. Symlinks are Entry events and are never followed.
- WriteOp
- A positional write borrowing its handle and payload without copying either.
Construction performs no I/O or allocation. Does not change the file cursor.
Uses the same storage definition as the native
crate::WriteOp. - Write
Options - Policy for positional vector writes. Defaults to reporting short writes. Completion is not atomicity, durability, or permission to replay failed RPCs.
- Write
Result - Application result for one vector write, in request order.
For completed append writes,
offset + writtenis the last reported end; concurrent writers can interleave between short-write waves.
Enums§
- Control
Flow - Used to tell an operation whether it should exit early or go on as usual.
- Error
Domain - Namespace in which a status code is meaningful.
- Error
Kind - A list specifying general categories of I/O error.
- File
Type - The NFSv4 object type, replacing the raw
NF4*wire codes inVfAttrs::ftype. - Remove
Mode - What each input to
Vfsi::vremoveremoves. - Rename
Options - Per-pair rename semantics requested by
Vfsi::vrename. - Status
Code - Typed protocol/filesystem status. Transport failures have no status.
- Stream
Completion - Completion of a streaming read. Stopping does not mean EOF.
- Sync
Mode - Durability requested for every handle in a synchronization vector.
- Target
- Borrowed filesystem operand: a path to resolve or an already-open object. Used by attribute updates, filesystem statistics, and scalar conveniences. Handle targets retain object identity across rename/unlink; path symlink policies do not change that identity. A target never owns or closes a handle.
- Transport
Kind - Transport provenance, not a guarantee that an operation is safe to retry.
Unknown failures remain
Other; messages are never parsed to classify them. - Traversal
Completion - Completion of a callback-based directory traversal.
- Walk
Control - Callback decision. Pruning never reads the directory’s contents.
- Walk
Event Kind - Enter/Leave surround a directory, including a pruned directory.
Constants§
- DEFAULT_
DIRECTORY_ MAX_ ENTRIES - Default maximum number of entries returned by allocating directory APIs.
- DEFAULT_
DIRECTORY_ MAX_ PATH_ BYTES - Default combined path-storage budget for allocating directory APIs.
- DEFAULT_
READV_ MAX_ TOTAL_ BYTES - Default aggregate payload limit for owned vector reads.
- DEFAULT_
READ_ ALLV_ MAX_ TOTAL_ BYTES - Default aggregate payload limit for complete-file vector reads.
- DEFAULT_
READ_ MAX_ BYTES - Default payload limit for APIs that allocate and return complete contents.
- DEFAULT_
READ_ STREAM_ CHUNK_ BYTES - Default size of each chunk delivered by the bounded single-file stream API.
- DEFAULT_
WALK_ MAX_ DEPTH - Default recursion depth for recursive walks.
Traits§
- AsTarget
- Borrow a target for metadata queries, attribute updates or filesystem statistics.
Paths can be passed directly; use
Targetfor handles or mixed vectors. Conversion performs no I/O. Clients convert each operand once at preflight and retain that target for routing, execution, and error context. - DirHandle
- Owned directory retaining the opened object’s identity after rename or path
replacement. Paths are diagnostic only; clients validate ownership and live
state before handle-rooted operations. Failed
try_closeretains cleanup ownership. - File
Handle - Owned application file. Borrowed requests preserve the file’s lifetime; clients validate connection ownership before dispatching a vector.
- Vfsi
- Vectorized filesystem operations for direct and routed application clients.
Construction, builders and protocol-specific diagnostics stay concrete.
Vectors are strict, ordered results on success, not transactions: errors
can follow partially completed requests and never imply rollback.
Generic vector and callback methods require static generic dispatch, not
dyn Vfsi. It adds no boxing, data copies or serial-loop fallbacks. - VfsiExt
- Scalar operations and convenience workflows alongside the
Vfsivectors.