Skip to main content

Module api

Module api 

Source
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§

Capabilities
Typed backend capabilities. Unlike the legacy integer constants, this rejects accidental mixing with unrelated bit fields.
CopyOption
Options for extent copying. Source final symlinks are followed by default. Ancestor symlinks use normal namespace resolution. This is not a snapshot. When preserving a source symlink, its text is copied and extent offsets and length are ignored. An existing destination is not replaced in that case. Destination symlinks for data copies retain normal following behavior.
DepthLimit
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.
DirectoryListing
One directory and its entries, with attributes fetched during enumeration.
FilesystemStats
Filesystem capacity and limits for the filesystem containing a target. Values are observations, not reservations. None means unknown or unsupported. Byte counts use the filesystem allocation unit, not its preferred I/O size.
Metadata
Idiomatic metadata returned by the Rust-native path API.
MetadataFields
A bitflags set of requested attributes.
MetadataOptions
Select metadata fields and whether to follow the final symlink. Ancestor symlinks use ordinary backend path-resolution semantics.
MetadataUpdate
Rust-native metadata changes used by Backend.
OpenFlags
Typed file-open behavior for the Rust-native API.
OpenRequest
One complete open request. This replaces three error-prone parallel slices of paths, flags, and modes.
Permissions
Rust-native permission bits, independent of protocol wire attributes.
ReadDirOptions
Resource limits for one allocating directory listing.
ReadIntoResult
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::vread returns, including on errors.
ReadOptions
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.
ReadResult
Progress for one operation, with no borrowed references to caller storage.
ReadStreamOptions
Tuning options for bounded single-file streaming reads.
RemoveOptions
Options controlling recursive removal.
ResourceLimits
Default resource policy for a client. Per-call options override it. Byte limits bound logical payload, not allocator capacity or RPC overhead.
VisitOptions
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.
WalkEvent
Root is depth zero. Symlinks are Entry events and are never followed.
WalkOptions
Resource limits for an allocating recursive directory walk.
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.
WriteOptions
Policy for positional vector writes. Defaults to reporting short writes. Completion is not atomicity, durability, or permission to replay failed RPCs.
WriteResult
Application result for one positional vector write, in request order.

Enums§

ControlFlow
Used to tell an operation whether it should exit early or go on as usual.
ErrorDomain
Namespace in which a status code is meaningful.
ErrorKind
A list specifying general categories of I/O error.
FileType
The NFSv4 object type, replacing the raw NF4* wire codes in VfAttrs::ftype.
MetadataTarget
A path or an opened object for an attribute update. Handle targets retain object identity across rename/unlink; follow_symlinks applies only to paths.
RemoveMode
What each input to Vfsi::vremove removes.
RenameOptions
Atomic destination behavior requested by Vfsi::vrename_with_options.
StatusCode
Typed protocol/filesystem status. Transport failures have no status.
StreamCompletion
Completion of a streaming read. Stopping does not mean EOF.
TransportKind
Transport provenance, not a guarantee that an operation is safe to retry. Unknown failures remain Other; messages are never parsed to classify them.
TraversalCompletion
Completion of a callback-based directory traversal.
WalkControl
Callback decision. Pruning never reads the directory’s contents.
WalkEventKind
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§

FileHandle
Owned application file. Borrowed requests preserve the file’s lifetime; clients validate connection ownership before dispatching a vector.
MetadataOperand
Inputs accepted by Vfsi::vsetattrs. Paths can be passed directly; use MetadataTarget to submit handles or mixed path/handle vectors.
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. This uses borrowed request GATs, so it is for static generic dispatch, not dyn Vfsi. It adds no boxing, data copies or serial-loop fallbacks.
VfsiExt
Scalar operations and convenience workflows alongside the Vfsi vectors.

Type Aliases§

Error
Result