Skip to main content

FsClient

Struct FsClient 

Source
pub struct FsClient<F: FileSystem> { /* private fields */ }
Expand description

Cloneable owner of one synchronous backend connection. Clones share a mutex and serialize backend calls; use separate connections for parallel RPCs. Explicitly close handles to observe cleanup failures. Handle Drop queues cleanup, drained before later operations or by drain_cleanup. Dropping the final backend owner performs synchronous teardown and may wait for pending closes and backend request timeouts.

Implementations§

Source§

impl<F: FileSystem> FsClient<F>

Source

pub fn new(filesystem: F) -> Self

Source

pub fn with_limits(self, limits: ResourceLimits) -> Self

Configure this client view and its future clones. Existing clones keep their policy; all views still share the same connection and ownership.

Source

pub fn limits(&self) -> ResourceLimits

Source

pub fn into_inner(self) -> Result<F, Self>

Source

pub fn drain_cleanup(&self) -> VfResult<()>

Drain queued Drop cleanup and report the first failure. Failed targets remain owned for later cleanup. No new file operation is replayed.

Source§

impl<F: FileSystem> FsClient<F>

Source

pub fn capabilities(&self) -> VfResult<Capabilities>

Source

pub fn open(&self, path: impl AsRef<Path>) -> VfResult<FsFile<F>>

Open a path read-only.

Source

pub fn open_with(&self, request: OpenRequest) -> VfResult<FsFile<F>>

Source

pub fn open_options(&self) -> OpenOptions<'_, F>

Source

pub fn create(&self, path: impl AsRef<Path>) -> VfResult<FsFile<F>>

Source

pub fn read(&self, path: impl AsRef<Path>) -> VfResult<Vec<u8>>

Source

pub fn read_with_limit( &self, path: impl AsRef<Path>, max_bytes: usize, ) -> VfResult<Vec<u8>>

Read one complete file while limiting the returned allocation.

Use FsFile::read_native or std::io::Read to stream files that should not be held in one allocation.

Source

pub fn read_to_string(&self, path: impl AsRef<Path>) -> VfResult<String>

Source

pub fn read_to_string_with_limit( &self, path: impl AsRef<Path>, max_bytes: usize, ) -> VfResult<String>

Read one complete UTF-8 file with a caller-selected allocation limit.

Source

pub fn write(&self, path: impl AsRef<Path>, data: &[u8]) -> VfResult<()>

Source§

impl<F: FileSystem> FsClient<F>

Source

pub fn read_stream( &self, path: impl AsRef<Path>, callback: impl FnMut(u64, &[u8]) -> VfResult<bool>, ) -> VfResult<StreamCompletion>

Stream one file from offset zero in bounded chunks.

The callback runs without holding the backend lock, so it may use this client or drop other files owned by it. Return Ok(false) to stop successfully. Callback errors are propagated. The file is closed on success, cancellation, callback error, or read error. At most one requested chunk is buffered at once.

Source

pub fn read_stream_with_options( &self, path: impl AsRef<Path>, options: ReadStreamOptions, callback: impl FnMut(u64, &[u8]) -> VfResult<bool>, ) -> VfResult<StreamCompletion>

Stream one file using an explicit maximum chunk size.

Source§

impl<F: Backend> FsClient<F>

Source

pub fn metadata(&self, path: impl AsRef<Path>) -> VfResult<Metadata>

Source

pub fn set_metadata(&self, path: impl AsRef<Path>) -> SetMetadata<'_, F>

Source§

impl<F: Backend> FsClient<F>

Source

pub fn create_dir(&self, path: impl AsRef<Path>) -> VfResult<()>

Source

pub fn create_dir_with_mode( &self, path: impl AsRef<Path>, mode: u32, ) -> VfResult<()>

Source

pub fn read_dir(&self, path: impl AsRef<Path>) -> VfResult<Vec<DirEntry>>

Source

pub fn read_dir_with_options( &self, path: impl AsRef<Path>, options: ReadDirOptions, ) -> VfResult<Vec<DirEntry>>

Read one directory with explicit entry and path-storage limits.

Source

pub fn visit_dir( &self, path: impl AsRef<Path>, callback: impl FnMut(DirEntry) -> VfResult<ControlFlow<()>>, ) -> VfResult<TraversalCompletion>

Visit one directory one bounded page at a time. Continue(()) requests the next entry; Break(()) stops the entire visit successfully. The callback runs without the lock and may reenter or drop its files.

Source

pub fn visit_dir_with_options( &self, path: impl AsRef<Path>, options: ReadDirOptions, callback: impl FnMut(DirEntry) -> VfResult<ControlFlow<()>>, ) -> VfResult<TraversalCompletion>

Visit entries with explicit entry and cumulative path-byte limits.

Source

pub fn visit_dir_with_fields( &self, path: impl AsRef<Path>, fields: AttrMask, options: ReadDirOptions, callback: impl FnMut(DirEntry) -> VfResult<ControlFlow<()>>, ) -> VfResult<TraversalCompletion>

Source§

impl<F: Backend> FsClient<F>

Source

pub fn create_dir_all(&self, path: impl AsRef<Path>) -> VfResult<()>

Source§

impl<F: Backend> FsClient<F>

Source

pub fn remove_file(&self, path: impl AsRef<Path>) -> VfResult<()>

Source

pub fn remove_dir(&self, path: impl AsRef<Path>) -> VfResult<()>

Source

pub fn remove_dir_all(&self, path: impl AsRef<Path>) -> VfResult<()>

Source

pub fn remove_dir_contents_impl(&self, path: impl AsRef<Path>) -> VfResult<()>

Remove the contents of a directory, keeping the directory itself.

Source

pub fn rename( &self, from: impl AsRef<Path>, to: impl AsRef<Path>, ) -> VfResult<()>

Source§

impl<F: Backend> FsClient<F>

Source

pub fn vrename<P: AsRef<Path>, Q: AsRef<Path>>( &self, pairs: &[(P, Q)], ) -> VfResult<()>

Rename independent source/destination pairs in one vector phase.

Source

pub fn vrename_with_options<P: AsRef<Path>, Q: AsRef<Path>>( &self, pairs: &[(P, Q)], options: RenameOptions, ) -> VfResult<()>

Rename pairs using native atomic no-replace semantics where supported.

Source

pub fn vmkdir_default<P: AsRef<Path>>(&self, paths: &[P]) -> VfResult<()>

Create directories in input order using vector MKDIR. Parents must already exist. This is not transactional: failure may leave a prefix.

Source

pub fn vmkdir<P: AsRef<Path>>(&self, directories: &[(P, u32)]) -> VfResult<()>

Create directories with per-request Unix permission bits.

Create symbolic links in one native backend vector.

Read targets without converting Unix path bytes through UTF-8.

Create hard links in one native backend vector.

Source

pub fn walk_events_with_options( &self, root: impl AsRef<Path>, fields: AttrMask, options: WalkOptions, sort_by_name: bool, callback: impl FnMut(&WalkEvent) -> VfResult<WalkControl>, ) -> VfResult<TraversalCompletion>

Lazy between directories, with selective no-follow metadata and pruning. Enter runs before any listing; Leave follows even a pruned directory. Sorting buffers one bounded directory, not the whole tree. The callback runs outside the backend lock. Limits include the starting object.

Source

pub fn visit_walk( &self, root: impl AsRef<Path>, callback: impl FnMut(&DirEntry) -> VfResult<ControlFlow<()>>, ) -> VfResult<TraversalCompletion>

Visit a tree using bounded directory pages, never follows symlinks, and invokes the callback outside the backend lock. Unlike collecting walk, this trades multi-directory batching for bounded incremental delivery. A backend without native paging may retain one bounded listing; finish its pages before descending, so snapshots never accumulate across ancestor directories. ControlFlow::Break(()) stops the entire walk successfully, not merely the current subtree. Directory order is backend-defined.

Source

pub fn visit_walk_with_options( &self, root: impl AsRef<Path>, options: WalkOptions, callback: impl FnMut(&DirEntry) -> VfResult<ControlFlow<()>>, ) -> VfResult<TraversalCompletion>

Source

pub fn visit_walk_with_fields( &self, root: impl AsRef<Path>, fields: AttrMask, options: WalkOptions, callback: impl FnMut(&DirEntry) -> VfResult<ControlFlow<()>>, ) -> VfResult<TraversalCompletion>

Source

pub fn directory_page_batch_size(&self) -> VfResult<usize>

Maximum safe cohort size for incremental directory paging.

Source

pub fn read_dir_pages_with_fields( &self, paths: &[&Path], fields: AttrMask, cursors: Vec<Option<DirPageCursor>>, page_size: usize, max_entries: usize, ) -> VfResult<Vec<DirectoryPage>>

Fetch a bounded vector of directory pages, retaining backend cursors.

Source

pub fn read_dirs<P: AsRef<Path>>( &self, paths: &[P], ) -> VfResult<Vec<DirectoryListing>>

List several directories with common stat attributes and finite allocation limits. Use read_dirs_with_options for richer fields.

Source§

impl<F: Backend> FsClient<F>

Source

pub fn walk(&self, root: impl AsRef<Path>) -> VfResult<Vec<DirectoryListing>>

Recursively enumerate a bounded tree with common stat attributes. Use walk_with_options to select fields or change limits.

Source

pub fn ensure_empty_dir(&self, path: impl AsRef<Path>) -> VfResult<()>

Create path if missing, otherwise empty it. Errors if it exists and is not a directory (a symlink to a directory is not a directory here).

Source

pub fn remove_dir_all_with_options( &self, path: impl AsRef<Path>, options: RemoveOptions, ) -> VfResult<()>

Remove a directory tree with explicit error, batching, and retry policy.

Source

pub fn remove_dir_contents_with_options( &self, path: impl AsRef<Path>, options: RemoveOptions, ) -> VfResult<()>

Empty a directory while keeping it, with explicit removal policy.

Source

pub fn open_dir_handle(&self, path: impl AsRef<Path>) -> VfResult<FsDir<F>>

Open a genuine directory handle for race-resistant, handle-rooted removal. Backends that only return a path fail instead of silently losing the handle safety guarantee.

Source§

impl<F: Backend> FsClient<F>

Source§

impl<F: Backend> FsClient<F>

Source

pub fn copy( &self, source: impl AsRef<Path>, destination: impl AsRef<Path>, ) -> VfResult<()>

Source§

impl<F: Backend> FsClient<F>

Fetch selected metadata for one path without following its final symlink. Unavailable fields remain None on Metadata.

Source

pub fn read_dirs_with_options<P: AsRef<Path>>( &self, paths: &[P], fields: AttrMask, options: ReadDirOptions, ) -> VfResult<Vec<DirectoryListing>>

List multiple directories in a vector call. The limits apply to the aggregate returned entries and stored path bytes. Streaming backends apply these limits before collecting a full listing; a backend using the compatibility visit_dir fallback may buffer one directory first. An error discards the collected prefix; callers may retry individual directories if desired.

Source

pub fn walk_with_options( &self, root: impl AsRef<Path>, fields: AttrMask, options: WalkOptions, ) -> VfResult<Vec<DirectoryListing>>

Recursively enumerate directories with selected entry attributes. The walk is bounded by options; sorting and presentation remain the application’s responsibility.

Source

pub fn vcopy<P: AsRef<Path>, Q: AsRef<Path>>( &self, pairs: &[(P, Q)], ) -> VfResult<()>

Copy whole files in request order. A successful prefix may remain if a later request fails; this operation does not provide atomicity.

Source

pub fn vremove_native<P: AsRef<Path>>( &self, paths: &[P], recursive: bool, ) -> VfResult<()>

Remove paths in request order, optionally recursing into directories. A successful prefix may remain if a later path fails.

Source

pub fn vremove_with_options_native<P: AsRef<Path>>( &self, paths: &[P], recursive: bool, options: RemoveOptions, ) -> VfResult<()>

Remove paths with explicit error, batching, and retry policy.

Source

pub fn vgetattrs_native<P: AsRef<Path>>( &self, paths: &[P], fields: AttrMask, follow: bool, ) -> VfResult<Vec<Metadata>>

Vector metadata query with explicit fields and final-symlink handling. Ancestor symlinks follow the backend’s normal namespace semantics.

Fetch no-follow metadata for many paths using the backend vector operation.

Source§

impl<F: Backend> FsClient<F>

Source

pub fn vopen(&self, requests: &[OpenRequest]) -> VfResult<Vec<FsFile<F>>>

Open an ordered vector of files.

Success returns one RAII handle per request. Failure returns no handles; VFSI does not promise transactional rollback of other filesystem effects such as file creation.

Source

pub fn vclose<'a>( &self, files: impl IntoIterator<Item = &'a mut FsFile<F>>, ) -> VfResult<()>
where F: 'a,

Try to close a group through one vector operation without consuming the handles. On failure, all handles remain armed: the backend may have closed a prefix, so callers must reconcile before retrying.

Source

pub fn vclose_owned(&self, files: Vec<FsFile<F>>) -> VfResult<()>

Close a group of files through one vector operation.

On failure, the handles are dropped and the backend receives best-effort scalar cleanup attempts. Use vclose to retain the handles after an error.

Source

pub fn vread_native( &self, requests: &[FsRead<'_, F>], ) -> VfResult<Vec<FsReadResult>>

Read an ordered vector with a 16 MiB aggregate request limit. Use vread_with_limit_native to tune the limit or vread_into_native to provide bounded caller-owned buffers.

Source

pub fn vread_with_limit_native( &self, requests: &[FsRead<'_, F>], max_total_bytes: usize, ) -> VfResult<Vec<FsReadResult>>

Read an ordered vector with an explicit aggregate request limit.

Source

pub fn vread_with_limit_projected_native<'b, T>( &self, requests: &[T], max_total_bytes: usize, project: impl for<'r> Fn(&'r T) -> &'r FsRead<'b, F>, ) -> VfResult<Vec<FsReadResult>>
where F: 'b,

Backend adapter for opaque application requests; projection does not allocate. The projection must return the same embedded request on every invocation.

Source

pub fn vread_into_native( &self, requests: &mut [FsReadInto<'_, F>], ) -> VfResult<Vec<FsReadIntoResult>>

Source

pub fn vread_into_with_limit_native( &self, requests: &mut [FsReadInto<'_, F>], max_bytes: usize, ) -> VfResult<Vec<FsReadIntoResult>>

Read into caller storage with an explicit aggregate buffer budget. This also bounds allocation in copying fallback implementations.

Source

pub fn vread_into_with_limit_projected_native<'b, T>( &self, requests: &mut [T], max_bytes: usize, project: impl for<'r> Fn(&'r T) -> &'r FsReadInto<'b, F>, project_mut: impl for<'r> FnMut(&'r mut T) -> &'r mut FsReadInto<'b, F>, ) -> VfResult<Vec<FsReadIntoResult>>
where F: 'b,

Project borrowed buffers without an intermediate request allocation. Both projections must identify the same embedded request, and remain stable across preflight, dispatch, and result validation.

Source

pub fn vwrite_native( &self, requests: &[FsWrite<'_, F>], ) -> VfResult<Vec<FsWriteResult>>

Source

pub fn vwrite_projected_native<'b, T>( &self, requests: &[T], project: impl for<'r> Fn(&'r T) -> &'r FsWrite<'b, F>, ) -> VfResult<Vec<FsWriteResult>>
where F: 'b,

Backend adapter for opaque application requests, preserving borrowed payloads. The projection must return the same embedded request on every invocation.

Source

pub fn vwrite_all_native( &self, requests: &[FsWrite<'_, F>], ) -> VfResult<Vec<FsWriteResult>>

Write every byte in each positional request, retrying short writes in vector waves. Like vwrite_native, this is not transactional: an error may follow a successfully written prefix. Overlapping requests through the same path complete in input order; different paths are presumed independent (including hard-link aliases).

Source

pub fn vwrite_all_projected_native<'b, T>( &self, requests: &[T], project: impl for<'r> Fn(&'r T) -> &'r FsWrite<'b, F>, ) -> VfResult<Vec<FsWriteResult>>
where F: 'b,

Complete projected requests with the same preflight and dependency waves. The projection must return the same embedded request on every invocation.

Source§

impl<F: Backend> FsClient<F>

Source

pub fn read_files<P: AsRef<Path>>(&self, paths: &[P]) -> VfResult<Vec<Vec<u8>>>

Read several complete files by path using vector READ operations.

The aggregate returned data is limited to 16 MiB by default. Use read_files_with_options to choose a different limit, or stream large files instead. This is not a snapshot or an atomic operation across files.

Source

pub fn read_files_with_options<P: AsRef<Path>>( &self, paths: &[P], options: ReadAllOptions, ) -> VfResult<Vec<Vec<u8>>>

Read several complete files with an explicit aggregate allocation limit.

Source

pub fn write_files<P: AsRef<Path>, B: AsRef<[u8]>>( &self, entries: &[(P, B)], ) -> VfResult<()>

Replace several files from borrowed buffers using vector OPEN, WRITE, and CLOSE phases. Identical path spellings are rejected before opening anything; aliases such as hard links are still the caller’s responsibility. The batch is not transactional: an error may follow files already created or written. Large inputs should be chunked by the caller rather than held in memory solely for this convenience method.

Source§

impl<F: FileSystem> FsClient<F>

Source

pub fn vstatfs<P: MetadataOperand<FsFile<F>>>( &self, targets: &[P], ) -> VfResult<Vec<FilesystemStats>>

Query filesystems using one native vector of paths and retained handles.

Source

pub fn vsetattrs<P: MetadataOperand<FsFile<F>>>( &self, updates: &[(P, MetadataUpdate)], follow_symlinks: bool, ) -> VfResult<()>

Update paths and open objects with one native attribute vector.

Trait Implementations§

Source§

impl<F: FileSystem> Clone for FsClient<F>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<F: FileSystem> Debug for FsClient<F>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: Backend + 'static> Vfsi for FsClient<F>

Source§

type File = FsFile<F>

Owned handle; vectors must contain handles belonging to this client.
Source§

fn vrename<P: AsRef<Path>, Q: AsRef<Path>>( &self, pairs: &[(P, Q)], ) -> Result<()>

Rename independent pairs in input order. Failures may leave a completed prefix. Source and destination belong to this filesystem’s namespace. Read more
Source§

fn vlistdirs<P: AsRef<Path>>( &self, paths: &[P], options: VisitOptions, callback: impl FnMut(usize, DirectoryListing) -> Result<ControlFlow<()>>, ) -> Result<Vec<TraversalCompletion>>

Visit shallow directories (default) or recursive trees using bounded pages. Entry/path-byte limits are shared across roots; recursive visits also charge retained directory path bytes. Root index accompanies every owned directory page, including empty directories. Callbacks run outside backend locks and may reenter. Entries for one directory may span several pages. Break stops the whole vector. The returned prefix covers every root whose pages reached the callback; unfinished roots are Stopped. Pages may interleave between roots. Read more
Source§

fn vstream<P: AsRef<Path>>( &self, paths: &[P], options: ReadStreamOptions, callback: impl FnMut(usize, u64, &[u8]) -> Result<bool>, ) -> Result<Vec<StreamCompletion>>

Stream files through bounded chunks without collecting whole contents. The callback receives the input index, byte offset, and borrowed chunk. False stops the whole vector; results contain its completed/stopped prefix. Backends may process streams sequentially; this is not a parallelism promise. Read more
Source§

fn capabilities(&self) -> Result<Capabilities>

Capabilities supported by this client. Routed clients report capabilities common to their routes; support does not imply authorization for a path.
Create symbolic links from (target text, link path) pairs. Targets are stored verbatim, including relative or dangling targets. Parents must exist. Errors may follow partial creation; no rollback.
Read symbolic link targets in input order without following final links. Returns their original path bytes, including non-UTF-8 names on Unix. An error identifies the input when known and discards collected results.
Create hard links from (existing source, new link path) pairs. Sources are not followed when the final component is a symlink. Cross-filesystem links can fail. Errors may follow partial creation.
Source§

fn vstatfs<P: MetadataOperand<Self::File>>( &self, targets: &[P], ) -> Result<Vec<FilesystemStats>>

Query filesystems for paths (following symlinks) and retained open handles. Results preserve input order. Unsupported fields are None.
Source§

fn vsetattrs<P: MetadataOperand<Self::File>>( &self, updates: &[(P, MetadataUpdate)], follow_symlinks: bool, ) -> Result<()>

Update selected attributes for paths or open handles using native batching. Every handle is validated before dispatch, including ownership and closure. Unspecified fields are unchanged. follow_symlinks controls the final component of path targets; it does not change open-handle identity. Ancestor symlinks retain ordinary backend resolution. Failure can follow partial mutations, including within one request; an error index identifies an input, not a committed-prefix count. Empty vectors succeed without I/O. Do not replay ambiguous failures. Read more
Source§

fn vgetattrs<P: AsRef<Path>>( &self, paths: &[P], options: MetadataOptions, ) -> Result<Vec<Metadata>>

Query metadata in input order with selected fields and final-symlink behavior. Backend execution must preserve vector batching. Ancestor symlinks use ordinary namespace resolution; this is not a snapshot or confinement API. Read more
Source§

fn limits(&self) -> ResourceLimits

Collection/batch defaults, not a process memory cap or file-reader cap. Read more
Source§

fn vopen(&self, requests: &[OpenRequest]) -> Result<Vec<Self::File>>

Strict ordered OPEN results. Failure releases returned handles but cannot undo files created/truncated earlier; index() is not a progress count. Read more
Source§

fn vread<'a>( &self, ops: impl IntoIterator<Item = ReadOp<'a, Self::File>>, options: ReadOptions, ) -> Result<Vec<ReadResult>>

Consume a read batch with an explicit aggregate logical-byte budget. Large files should usually be streamed instead of increasing the budget. Explicit options override client defaults. Read more
Source§

fn vwrite<'a>( &self, requests: &[WriteOp<'a, Self::File>], options: WriteOptions, ) -> Result<Vec<WriteResult>>

Write positional ranges with explicit short-write policy. With default options, report accepted byte counts without completing short writes. With write_all(true), finish short writes after whole-batch local preflight. Backend failures can still follow mutations; aliasing paths are the caller’s responsibility and do not imply transactional ordering. Read more
Source§

fn vclose(&self, files: &mut [Self::File]) -> Result<()>

Retain handles for failed cleanup; completed groups can already be closed. A lost reply leaves remote state ambiguous, not safely open. Read more
Source§

fn vmkdir<P: AsRef<Path>>(&self, paths: &[(P, u32)]) -> Result<()>

Strict vector directory creation. Parents must already exist; errors can follow completed mutations, and do not imply rollback. Read more
Source§

fn vcopy<P: AsRef<Path>, Q: AsRef<Path>>(&self, pairs: &[(P, Q)]) -> Result<()>

Strict file-copy batches; a failed call can have copied earlier files. Read more
Source§

fn vremove<P: AsRef<Path>>( &self, paths: &[P], mode: RemoveMode, options: RemoveOptions, ) -> Result<()>

Remove entries, recursive trees, or directory contents with explicit policy. Read more
Source§

fn vrename_with_options<P, Q>( &self, pairs: &[(P, Q)], options: RenameOptions, ) -> Result<(), VfError>
where P: AsRef<Path>, Q: AsRef<Path>,

Rename pairs with explicit atomic destination behavior. Each NoReplace pair is atomic, but a vector is not a transaction and a prefix may complete before a later pair fails. Backends without a native guarantee return Unsupported; they must never emulate it with check-then-rename. Read more

Auto Trait Implementations§

§

impl<F> Freeze for FsClient<F>
where Arc<SharedBackend<F>>: Freeze,

§

impl<F> RefUnwindSafe for FsClient<F>
where Arc<SharedBackend<F>>: RefUnwindSafe,

§

impl<F> Send for FsClient<F>
where Arc<SharedBackend<F>>: Send,

§

impl<F> Sync for FsClient<F>
where Arc<SharedBackend<F>>: Sync,

§

impl<F> Unpin for FsClient<F>
where Arc<SharedBackend<F>>: Unpin,

§

impl<F> UnsafeUnpin for FsClient<F>
where Arc<SharedBackend<F>>: UnsafeUnpin,

§

impl<F> UnwindSafe for FsClient<F>
where Arc<SharedBackend<F>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<C> VfsiExt for C
where C: Vfsi + ?Sized,

Source§

fn statfs<P>(&self, target: P) -> Result<FilesystemStats, VfError>
where P: MetadataOperand<Self::File>,

Query one target through the vector filesystem-statistics engine.
Source§

fn open(&self, path: impl AsRef<Path>) -> Result<Self::File, VfError>

Single-target convenience. For multiple files, prefer Vfsi::vopen to expose batching opportunities. Read more
Source§

fn create(&self, path: impl AsRef<Path>) -> Result<Self::File, VfError>

Single-target convenience. For multiple creations, prefer Vfsi::vopen with CREATE/TRUNCATE flags. Read more
Source§

fn open_with(&self, request: OpenRequest) -> Result<Self::File, VfError>

Single-target convenience. For multiple requests, prefer Vfsi::vopen with per-file flags and modes. Read more
Source§

fn close_files(&self, files: Vec<Self::File>) -> Result<(), VfError>

Consume all handles. Errors cannot return cleanup ownership; Drop is best-effort. Prefer vclose when close errors require reconciliation. Read more
Source§

fn read_files<P>(&self, paths: &[P]) -> Result<Vec<Vec<u8>>, VfError>
where P: AsRef<Path>,

Read complete files in input order using vectorized whole-file reads. Read more
Source§

fn read_files_with_options<P>( &self, paths: &[P], options: ReadOptions, ) -> Result<Vec<Vec<u8>>, VfError>
where P: AsRef<Path>,

Whole-file convenience reads with an explicit aggregate payload budget. Read more
Source§

fn read_to_string(&self, path: impl AsRef<Path>) -> Result<String, VfError>

Single-target convenience. For multiple files, prefer Vfsi::vread with whole-file operations and decode each result as UTF-8. Read more
Source§

fn read_to_string_with_options( &self, path: impl AsRef<Path>, options: ReadOptions, ) -> Result<String, VfError>

Single-target convenience. For multiple files, prefer Vfsi::vread with an aggregate byte budget, then decode UTF-8. Read more
Source§

fn read_stream( &self, path: impl AsRef<Path>, callback: impl FnMut(u64, &[u8]) -> Result<bool, VfError>, ) -> Result<StreamCompletion, VfError>

Single-target convenience. For multiple files, prefer Vfsi::vstream. Backends may process streams sequentially. Read more
Source§

fn read_stream_with_options( &self, path: impl AsRef<Path>, options: ReadStreamOptions, callback: impl FnMut(u64, &[u8]) -> Result<bool, VfError>, ) -> Result<StreamCompletion, VfError>

Single-target convenience. For multiple files, prefer Vfsi::vstream. Backends may process streams sequentially. Read more
Source§

fn write(&self, path: impl AsRef<Path>, data: &[u8]) -> Result<(), VfError>

Single-target convenience. For multiple complete files, prefer VfsiExt::write_files; for opened handles, prefer Vfsi::vwrite. Read more
Source§

fn write_files<P, B>(&self, entries: &[(P, B)]) -> Result<(), VfError>
where P: AsRef<Path>, B: AsRef<[u8]>,

Replace files in vector phases. Success completes payloads; errors may follow create/truncate/write effects and never authorize blind replay. Read more
Source§

fn metadata(&self, path: impl AsRef<Path>) -> Result<Metadata, VfError>

Single-target convenience. For multiple paths, prefer Vfsi::vgetattrs. Read more
Source§

fn metadata_with_options( &self, path: impl AsRef<Path>, options: MetadataOptions, ) -> Result<Metadata, VfError>

Single-target convenience. For multiple paths, prefer Vfsi::vgetattrs with selected fields and follow_symlinks(false). Read more
Single-target convenience. For multiple paths, prefer Vfsi::vgetattrs with follow_symlinks(false). Read more
Source§

fn read_dir(&self, path: impl AsRef<Path>) -> Result<Vec<DirEntry>, VfError>

Single-target convenience. For multiple directories, prefer VfsiExt::read_dirs_with_options or VfsiExt::read_dirs. Read more
Source§

fn read_dir_with_options( &self, path: impl AsRef<Path>, options: VisitOptions, ) -> Result<Vec<DirEntry>, VfError>

Single-target convenience. For multiple directories, prefer VfsiExt::read_dirs_with_options with one aggregate budget. Read more
Source§

fn read_dirs<P>(&self, paths: &[P]) -> Result<Vec<DirectoryListing>, VfError>
where P: AsRef<Path>,

Collect directory listings under one aggregate entry/path-byte policy. Read more
Source§

fn read_dirs_with_options<P>( &self, paths: &[P], options: VisitOptions, ) -> Result<Vec<Vec<DirectoryListing>>, VfError>
where P: AsRef<Path>,

Collect shallow directories or recursive trees, grouped by input root. Read more
Source§

fn walk(&self, root: impl AsRef<Path>) -> Result<Vec<DirectoryListing>, VfError>

Single-target convenience. For multiple roots, prefer VfsiExt::read_dirs_with_options. Read more
Source§

fn walk_with_options( &self, path: impl AsRef<Path>, options: VisitOptions, ) -> Result<Vec<DirectoryListing>, VfError>

Single-target convenience. For multiple roots, prefer VfsiExt::read_dirs_with_options with one aggregate budget. Read more
Source§

fn visit_dir( &self, path: impl AsRef<Path>, callback: impl FnMut(&DirEntry) -> Result<ControlFlow<()>, VfError>, ) -> Result<TraversalCompletion, VfError>

Single-target convenience. For multiple directories, prefer Vfsi::vlistdirs. Read more
Source§

fn visit_walk( &self, root: impl AsRef<Path>, callback: impl FnMut(&DirEntry) -> Result<ControlFlow<()>, VfError>, ) -> Result<TraversalCompletion, VfError>

Single-target convenience. For multiple roots, prefer Vfsi::vlistdirs. Read more
Source§

fn visit_dir_with_options( &self, path: impl AsRef<Path>, options: VisitOptions, callback: impl FnMut(&DirEntry) -> Result<ControlFlow<()>, VfError>, ) -> Result<TraversalCompletion, VfError>

Single-target convenience. For multiple directories, prefer Vfsi::vlistdirs. Read more
Source§

fn visit_entries_with_options<P>( &self, paths: &[P], options: VisitOptions, callback: impl FnMut(usize, &DirEntry) -> Result<ControlFlow<()>, VfError>, ) -> Result<Vec<TraversalCompletion>, VfError>
where P: AsRef<Path>,

Visit individual entries using the directory-page primitive. Empty directories produce pages but no entry callbacks.
Source§

fn walk_events_with_options( &self, root: impl AsRef<Path>, fields: AttrMask, options: WalkOptions, sort_by_name: bool, callback: impl FnMut(&WalkEvent) -> Result<WalkControl, VfError>, ) -> Result<TraversalCompletion, VfError>

Single-target convenience. For multiple roots without enter/leave events or subtree pruning, prefer Vfsi::vlistdirs. Keep this helper when those event semantics are required. Read more
Source§

fn visit_dirs_ordered( &self, root: impl AsRef<Path>, fields: AttrMask, options: WalkOptions, order: impl FnMut(&mut [DirEntry]), descend: impl FnMut(&DirEntry) -> bool, visitor: impl FnMut(DirectoryListing, usize) -> Result<WalkControl, VfError>, ) -> Result<TraversalCompletion, VfError>

Visit complete shallow listings in depth-first order with application policy. Read more
Source§

fn create_dir(&self, path: impl AsRef<Path>) -> Result<(), VfError>

Single-target convenience. For multiple independent directories, prefer Vfsi::vmkdir. Read more
Source§

fn truncate<T>(&self, target: T, len: u64) -> Result<(), VfError>
where T: MetadataOperand<Self::File>,

Truncate or extend one path or opened object using Vfsi::vsetattrs.
Source§

fn chmod<T>(&self, target: T, permissions: Permissions) -> Result<(), VfError>
where T: MetadataOperand<Self::File>,

Change permissions on one path or opened object using Vfsi::vsetattrs.
Source§

fn chown<T>( &self, target: T, uid: Option<u32>, gid: Option<u32>, ) -> Result<(), VfError>
where T: MetadataOperand<Self::File>,

Change ownership of one path or opened object through Vfsi::vsetattrs. None leaves the corresponding owner/group unchanged. Use the vector with follow_symlinks = false to change a symlink itself.
Source§

fn create_dir_with_mode( &self, path: impl AsRef<Path>, mode: u32, ) -> Result<(), VfError>

Create one directory with explicit Unix permission bits.
Create one symbolic link; submit multiple pairs with Vfsi::vsymlink.
Read one symlink target; submit multiple paths with Vfsi::vreadlink.
Create one hard link; submit multiple pairs with Vfsi::vhardlink.
Source§

fn create_dir_all(&self, path: impl AsRef<Path>) -> Result<(), VfError>

Single-target convenience. For multiple directory creations, prefer Vfsi::vmkdir; plan missing parents before their children. Read more
Source§

fn rename( &self, source: impl AsRef<Path>, destination: impl AsRef<Path>, ) -> Result<(), VfError>

Single-target convenience. For multiple source/destination pairs, prefer Vfsi::vrename. Read more
Source§

fn copy( &self, source: impl AsRef<Path>, destination: impl AsRef<Path>, ) -> Result<(), VfError>

Single-target convenience. For multiple file pairs, prefer Vfsi::vcopy. Read more
Source§

fn remove_file(&self, path: impl AsRef<Path>) -> Result<(), VfError>

Single-target convenience. For multiple paths, prefer Vfsi::vremove. That vector API accepts both files and directories. Read more
Source§

fn remove_dir(&self, path: impl AsRef<Path>) -> Result<(), VfError>

Single-target convenience. For multiple paths, prefer Vfsi::vremove. That vector API does not enforce directory-only inputs. Read more
Source§

fn remove_dir_all(&self, path: impl AsRef<Path>) -> Result<(), VfError>

Single-target convenience. For multiple trees, prefer Vfsi::vremove with RemoveMode::Tree. Read more
Source§

fn remove_dir_contents(&self, path: impl AsRef<Path>) -> Result<(), VfError>

Single-target convenience. For multiple directory roots, prefer Vfsi::vremove. Read more