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>
impl<F: FileSystem> FsClient<F>
pub fn new(filesystem: F) -> Self
Sourcepub fn with_limits(self, limits: ResourceLimits) -> Self
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.
pub fn limits(&self) -> ResourceLimits
pub fn into_inner(self) -> Result<F, Self>
Sourcepub fn drain_cleanup(&self) -> VfResult<()>
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>
impl<F: FileSystem> FsClient<F>
pub fn capabilities(&self) -> VfResult<Capabilities>
pub fn open_with(&self, request: OpenRequest) -> VfResult<FsFile<F>>
pub fn open_options(&self) -> OpenOptions<'_, F>
pub fn create(&self, path: impl AsRef<Path>) -> VfResult<FsFile<F>>
pub fn read(&self, path: impl AsRef<Path>) -> VfResult<Vec<u8>>
Sourcepub fn read_with_limit(
&self,
path: impl AsRef<Path>,
max_bytes: usize,
) -> VfResult<Vec<u8>>
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.
pub fn read_to_string(&self, path: impl AsRef<Path>) -> VfResult<String>
Sourcepub fn read_to_string_with_limit(
&self,
path: impl AsRef<Path>,
max_bytes: usize,
) -> VfResult<String>
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.
pub fn write(&self, path: impl AsRef<Path>, data: &[u8]) -> VfResult<()>
Source§impl<F: FileSystem> FsClient<F>
impl<F: FileSystem> FsClient<F>
Sourcepub fn read_stream(
&self,
path: impl AsRef<Path>,
callback: impl FnMut(u64, &[u8]) -> VfResult<bool>,
) -> VfResult<StreamCompletion>
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.
Sourcepub fn read_stream_with_options(
&self,
path: impl AsRef<Path>,
options: ReadStreamOptions,
callback: impl FnMut(u64, &[u8]) -> VfResult<bool>,
) -> VfResult<StreamCompletion>
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: MetadataFileSystem> FsClient<F>
impl<F: MetadataFileSystem> FsClient<F>
Source§impl<F: DirectoryFileSystem> FsClient<F>
impl<F: DirectoryFileSystem> FsClient<F>
pub fn create_dir(&self, path: impl AsRef<Path>) -> VfResult<()>
pub fn create_dir_with_mode( &self, path: impl AsRef<Path>, mode: u32, ) -> VfResult<()>
pub fn read_dir(&self, path: impl AsRef<Path>) -> VfResult<Vec<DirEntry>>
Sourcepub fn read_dir_with_options(
&self,
path: impl AsRef<Path>,
options: ReadDirOptions,
) -> VfResult<Vec<DirEntry>>
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.
Sourcepub fn visit_dir(
&self,
path: impl AsRef<Path>,
callback: impl FnMut(DirEntry) -> VfResult<ControlFlow<()>>,
) -> VfResult<TraversalCompletion>
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.
Sourcepub fn visit_dir_with_options(
&self,
path: impl AsRef<Path>,
options: ReadDirOptions,
callback: impl FnMut(DirEntry) -> VfResult<ControlFlow<()>>,
) -> VfResult<TraversalCompletion>
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.
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: DirectoryFileSystem + MetadataFileSystem> FsClient<F>
impl<F: DirectoryFileSystem + MetadataFileSystem> FsClient<F>
Source§impl<F: NamespaceFileSystem + MetadataFileSystem> FsClient<F>
impl<F: NamespaceFileSystem + MetadataFileSystem> FsClient<F>
pub fn remove_file(&self, path: impl AsRef<Path>) -> VfResult<()>
pub fn remove_dir(&self, path: impl AsRef<Path>) -> VfResult<()>
pub fn remove_dir_all(&self, path: impl AsRef<Path>) -> VfResult<()>
Sourcepub fn remove_dir_contents(&self, path: impl AsRef<Path>) -> VfResult<()>
pub fn remove_dir_contents(&self, path: impl AsRef<Path>) -> VfResult<()>
Remove the contents of a directory, keeping the directory itself.
pub fn rename( &self, from: impl AsRef<Path>, to: impl AsRef<Path>, ) -> VfResult<()>
Source§impl<F: VecFs> FsClient<F>
impl<F: VecFs> FsClient<F>
Sourcepub fn renamev<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
pairs: &[(P, Q)],
) -> VfResult<()>
pub fn renamev<P: AsRef<Path>, Q: AsRef<Path>>( &self, pairs: &[(P, Q)], ) -> VfResult<()>
Rename independent source/destination pairs in one vector phase.
Sourcepub fn mkdirv<P: AsRef<Path>>(&self, paths: &[P]) -> VfResult<()>
pub fn mkdirv<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.
Sourcepub 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>
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.
Sourcepub fn visit_walk(
&self,
root: impl AsRef<Path>,
callback: impl FnMut(&DirEntry) -> VfResult<ControlFlow<()>>,
) -> VfResult<TraversalCompletion>
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.
pub fn visit_walk_with_options( &self, root: impl AsRef<Path>, options: WalkOptions, callback: impl FnMut(&DirEntry) -> VfResult<ControlFlow<()>>, ) -> VfResult<TraversalCompletion>
pub fn visit_walk_with_fields( &self, root: impl AsRef<Path>, fields: AttrMask, options: WalkOptions, callback: impl FnMut(&DirEntry) -> VfResult<ControlFlow<()>>, ) -> VfResult<TraversalCompletion>
Sourcepub fn directory_page_batch_size(&self) -> VfResult<usize>
pub fn directory_page_batch_size(&self) -> VfResult<usize>
Maximum safe cohort size for incremental directory paging.
Source§impl<F: VecFs> FsClient<F>
impl<F: VecFs> FsClient<F>
Sourcepub fn walk(&self, root: impl AsRef<Path>) -> VfResult<Vec<DirectoryListing>>
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.
Sourcepub fn ensure_empty_dir(&self, path: impl AsRef<Path>) -> VfResult<()>
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).
Sourcepub fn remove_dir_all_with_options(
&self,
path: impl AsRef<Path>,
options: RemoveOptions,
) -> VfResult<()>
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.
Sourcepub fn remove_dir_contents_with_options(
&self,
path: impl AsRef<Path>,
options: RemoveOptions,
) -> VfResult<()>
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§impl<F: LinkFileSystem> FsClient<F>
impl<F: LinkFileSystem> FsClient<F>
Source§impl<F: CopyFileSystem> FsClient<F>
impl<F: CopyFileSystem> FsClient<F>
Source§impl<F: VecFs> FsClient<F>
impl<F: VecFs> FsClient<F>
Sourcepub fn symlink_metadata_with_fields(
&self,
path: impl AsRef<Path>,
fields: AttrMask,
) -> VfResult<Metadata>
pub fn symlink_metadata_with_fields( &self, path: impl AsRef<Path>, fields: AttrMask, ) -> VfResult<Metadata>
Fetch selected metadata for one path without following its final symlink.
Unavailable fields remain None on Metadata.
Sourcepub fn read_dirs_with_options<P: AsRef<Path>>(
&self,
paths: &[P],
fields: AttrMask,
options: ReadDirOptions,
) -> VfResult<Vec<DirectoryListing>>
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.
Sourcepub fn walk_with_options(
&self,
root: impl AsRef<Path>,
fields: AttrMask,
options: WalkOptions,
) -> VfResult<Vec<DirectoryListing>>
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.
Sourcepub fn copyv<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
pairs: &[(P, Q)],
) -> VfResult<()>
pub fn copyv<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.
Sourcepub fn remove_paths<P: AsRef<Path>>(
&self,
paths: &[P],
recursive: bool,
) -> VfResult<()>
pub fn remove_paths<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.
Sourcepub fn remove_paths_with_options<P: AsRef<Path>>(
&self,
paths: &[P],
recursive: bool,
options: RemoveOptions,
) -> VfResult<()>
pub fn remove_paths_with_options<P: AsRef<Path>>( &self, paths: &[P], recursive: bool, options: RemoveOptions, ) -> VfResult<()>
Remove paths with explicit error, batching, and retry policy.
Source§impl<F: VectorFileSystem> FsClient<F>
impl<F: VectorFileSystem> FsClient<F>
Sourcepub fn openv(&self, requests: &[OpenRequest]) -> VfResult<Vec<FsFile<F>>>
pub fn openv(&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.
Sourcepub fn try_closev<'a>(
&self,
files: impl IntoIterator<Item = &'a mut FsFile<F>>,
) -> VfResult<()>where
F: 'a,
pub fn try_closev<'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.
Sourcepub fn closev(&self, files: Vec<FsFile<F>>) -> VfResult<()>
pub fn closev(&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 try_closev
to retain the handles after an error.
Sourcepub fn readv(&self, requests: &[FsRead<'_, F>]) -> VfResult<Vec<FsReadResult>>
pub fn readv(&self, requests: &[FsRead<'_, F>]) -> VfResult<Vec<FsReadResult>>
Read an ordered vector with a 16 MiB aggregate request limit.
Use readv_with_limit to tune the limit or
readv_into to provide bounded caller-owned buffers.
Sourcepub fn readv_with_limit(
&self,
requests: &[FsRead<'_, F>],
max_total_bytes: usize,
) -> VfResult<Vec<FsReadResult>>
pub fn readv_with_limit( &self, requests: &[FsRead<'_, F>], max_total_bytes: usize, ) -> VfResult<Vec<FsReadResult>>
Read an ordered vector with an explicit aggregate request limit.
Sourcepub fn readv_with_limit_projected<'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,
pub fn readv_with_limit_projected<'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.
pub fn readv_into( &self, requests: &mut [FsReadInto<'_, F>], ) -> VfResult<Vec<FsReadIntoResult>>
Sourcepub fn readv_into_with_limit(
&self,
requests: &mut [FsReadInto<'_, F>],
max_bytes: usize,
) -> VfResult<Vec<FsReadIntoResult>>
pub fn readv_into_with_limit( &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.
Sourcepub fn readv_into_with_limit_projected<'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,
pub fn readv_into_with_limit_projected<'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.
pub fn writev( &self, requests: &[FsWrite<'_, F>], ) -> VfResult<Vec<FsWriteResult>>
Sourcepub fn writev_projected<'b, T>(
&self,
requests: &[T],
project: impl for<'r> Fn(&'r T) -> &'r FsWrite<'b, F>,
) -> VfResult<Vec<FsWriteResult>>where
F: 'b,
pub fn writev_projected<'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.
Sourcepub fn write_allv(
&self,
requests: &[FsWrite<'_, F>],
) -> VfResult<Vec<FsWriteResult>>
pub fn write_allv( &self, requests: &[FsWrite<'_, F>], ) -> VfResult<Vec<FsWriteResult>>
Write every byte in each positional request, retrying short writes in
vector waves. Like writev, 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).
Sourcepub fn write_allv_projected<'b, T>(
&self,
requests: &[T],
project: impl for<'r> Fn(&'r T) -> &'r FsWrite<'b, F>,
) -> VfResult<Vec<FsWriteResult>>where
F: 'b,
pub fn write_allv_projected<'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: VectorFileSystem + VecFs> FsClient<F>
impl<F: VectorFileSystem + VecFs> FsClient<F>
Sourcepub fn read_files<P: AsRef<Path>>(&self, paths: &[P]) -> VfResult<Vec<Vec<u8>>>
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.
Sourcepub fn read_files_with_options<P: AsRef<Path>>(
&self,
paths: &[P],
options: ReadAllOptions,
) -> VfResult<Vec<Vec<u8>>>
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.
Sourcepub fn write_files<P: AsRef<Path>, B: AsRef<[u8]>>(
&self,
entries: &[(P, B)],
) -> VfResult<()>
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.
Trait Implementations§
Source§impl<F: FileSystem> Clone for FsClient<F>
impl<F: FileSystem> Clone for FsClient<F>
Source§impl<F: FileSystem> Debug for FsClient<F>
impl<F: FileSystem> Debug for FsClient<F>
Source§impl<F: NativeFileSystem + VectorFileSystem + VecFs + 'static> Vfsi for FsClient<F>
impl<F: NativeFileSystem + VectorFileSystem + VecFs + 'static> Vfsi for FsClient<F>
Source§fn vrename<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
pairs: &[(P, Q)],
) -> Result<()>
fn vrename<P: AsRef<Path>, Q: AsRef<Path>>( &self, pairs: &[(P, Q)], ) -> Result<()>
Source§fn vlistdirs<P: AsRef<Path>>(
&self,
paths: &[P],
options: VisitOptions,
callback: impl FnMut(usize, DirectoryListing) -> Result<ControlFlow<()>>,
) -> Result<Vec<TraversalCompletion>>
fn vlistdirs<P: AsRef<Path>>( &self, paths: &[P], options: VisitOptions, callback: impl FnMut(usize, DirectoryListing) -> Result<ControlFlow<()>>, ) -> Result<Vec<TraversalCompletion>>
Source§fn vstream<P: AsRef<Path>>(
&self,
paths: &[P],
options: ReadStreamOptions,
callback: impl FnMut(usize, u64, &[u8]) -> Result<bool>,
) -> Result<Vec<StreamCompletion>>
fn vstream<P: AsRef<Path>>( &self, paths: &[P], options: ReadStreamOptions, callback: impl FnMut(usize, u64, &[u8]) -> Result<bool>, ) -> Result<Vec<StreamCompletion>>
Source§fn vgetattrs<P: AsRef<Path>>(
&self,
paths: &[P],
options: MetadataOptions,
) -> Result<Vec<Metadata>>
fn vgetattrs<P: AsRef<Path>>( &self, paths: &[P], options: MetadataOptions, ) -> Result<Vec<Metadata>>
Source§fn limits(&self) -> ResourceLimits
fn limits(&self) -> ResourceLimits
Source§fn vopen(&self, requests: &[OpenRequest]) -> Result<Vec<Self::File>>
fn vopen(&self, requests: &[OpenRequest]) -> Result<Vec<Self::File>>
index() is not a progress count. Read moreSource§fn vread<'a>(
&self,
ops: impl IntoIterator<Item = ReadOp<'a, Self::File>>,
options: ReadOptions,
) -> Result<Vec<ReadResult>>
fn vread<'a>( &self, ops: impl IntoIterator<Item = ReadOp<'a, Self::File>>, options: ReadOptions, ) -> Result<Vec<ReadResult>>
Source§fn vwrite<'a>(
&self,
requests: &[WriteOp<'a, Self::File>],
options: WriteOptions,
) -> Result<Vec<WriteResult>>
fn vwrite<'a>( &self, requests: &[WriteOp<'a, Self::File>], options: WriteOptions, ) -> Result<Vec<WriteResult>>
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 moreSource§fn vclose(&self, files: &mut [Self::File]) -> Result<()>
fn vclose(&self, files: &mut [Self::File]) -> Result<()>
Source§fn vmkdir<P: AsRef<Path>>(&self, paths: &[P]) -> Result<()>
fn vmkdir<P: AsRef<Path>>(&self, paths: &[P]) -> Result<()>
Auto Trait Implementations§
impl<F> Freeze for FsClient<F>
impl<F> RefUnwindSafe for FsClient<F>where
Arc<SharedBackend<F>>: RefUnwindSafe,
impl<F> Send for FsClient<F>
impl<F> Sync for FsClient<F>
impl<F> Unpin for FsClient<F>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C> VfsiExt for C
impl<C> VfsiExt for C
Source§fn open(&self, path: impl AsRef<Path>) -> Result<Self::File, VfError>
fn open(&self, path: impl AsRef<Path>) -> Result<Self::File, VfError>
Vfsi::vopen to expose batching opportunities. Read moreSource§fn create(&self, path: impl AsRef<Path>) -> Result<Self::File, VfError>
fn create(&self, path: impl AsRef<Path>) -> Result<Self::File, VfError>
Vfsi::vopen with CREATE/TRUNCATE flags. Read moreSource§fn open_with(&self, request: OpenRequest) -> Result<Self::File, VfError>
fn open_with(&self, request: OpenRequest) -> Result<Self::File, VfError>
Vfsi::vopen with per-file flags and modes. Read moreSource§fn close_files(&self, files: Vec<Self::File>) -> Result<(), VfError>
fn close_files(&self, files: Vec<Self::File>) -> Result<(), VfError>
vclose when close errors require reconciliation. Read moreSource§fn read_files<P>(&self, paths: &[P]) -> Result<Vec<Vec<u8>>, VfError>
fn read_files<P>(&self, paths: &[P]) -> Result<Vec<Vec<u8>>, VfError>
Source§fn read_files_with_options<P>(
&self,
paths: &[P],
options: ReadOptions,
) -> Result<Vec<Vec<u8>>, VfError>
fn read_files_with_options<P>( &self, paths: &[P], options: ReadOptions, ) -> Result<Vec<Vec<u8>>, VfError>
Source§fn read_to_string(&self, path: impl AsRef<Path>) -> Result<String, VfError>
fn read_to_string(&self, path: impl AsRef<Path>) -> Result<String, VfError>
Vfsi::vread with whole-file operations and decode each result as UTF-8. Read moreSource§fn read_to_string_with_options(
&self,
path: impl AsRef<Path>,
options: ReadOptions,
) -> Result<String, VfError>
fn read_to_string_with_options( &self, path: impl AsRef<Path>, options: ReadOptions, ) -> Result<String, VfError>
Vfsi::vread with an aggregate byte budget, then decode UTF-8. Read moreSource§fn read_stream(
&self,
path: impl AsRef<Path>,
callback: impl FnMut(u64, &[u8]) -> Result<bool, VfError>,
) -> Result<StreamCompletion, VfError>
fn read_stream( &self, path: impl AsRef<Path>, callback: impl FnMut(u64, &[u8]) -> Result<bool, VfError>, ) -> Result<StreamCompletion, VfError>
Vfsi::vstream. Backends may process streams sequentially. Read moreSource§fn read_stream_with_options(
&self,
path: impl AsRef<Path>,
options: ReadStreamOptions,
callback: impl FnMut(u64, &[u8]) -> Result<bool, VfError>,
) -> Result<StreamCompletion, VfError>
fn read_stream_with_options( &self, path: impl AsRef<Path>, options: ReadStreamOptions, callback: impl FnMut(u64, &[u8]) -> Result<bool, VfError>, ) -> Result<StreamCompletion, VfError>
Vfsi::vstream. Backends may process streams sequentially. Read moreSource§fn write(&self, path: impl AsRef<Path>, data: &[u8]) -> Result<(), VfError>
fn write(&self, path: impl AsRef<Path>, data: &[u8]) -> Result<(), VfError>
VfsiExt::write_files; for opened handles, prefer Vfsi::vwrite. Read moreSource§fn write_files<P, B>(&self, entries: &[(P, B)]) -> Result<(), VfError>
fn write_files<P, B>(&self, entries: &[(P, B)]) -> Result<(), VfError>
Source§fn metadata(&self, path: impl AsRef<Path>) -> Result<Metadata, VfError>
fn metadata(&self, path: impl AsRef<Path>) -> Result<Metadata, VfError>
Vfsi::vgetattrs. Read moreSource§fn metadata_with_options(
&self,
path: impl AsRef<Path>,
options: MetadataOptions,
) -> Result<Metadata, VfError>
fn metadata_with_options( &self, path: impl AsRef<Path>, options: MetadataOptions, ) -> Result<Metadata, VfError>
Vfsi::vgetattrs with selected fields and follow_symlinks(false). Read moreSource§fn symlink_metadata(&self, path: impl AsRef<Path>) -> Result<Metadata, VfError>
fn symlink_metadata(&self, path: impl AsRef<Path>) -> Result<Metadata, VfError>
Vfsi::vgetattrs with follow_symlinks(false). Read moreSource§fn read_dir(&self, path: impl AsRef<Path>) -> Result<Vec<DirEntry>, VfError>
fn read_dir(&self, path: impl AsRef<Path>) -> Result<Vec<DirEntry>, VfError>
VfsiExt::read_dirs_with_options or VfsiExt::read_dirs. Read moreSource§fn read_dir_with_options(
&self,
path: impl AsRef<Path>,
options: VisitOptions,
) -> Result<Vec<DirEntry>, VfError>
fn read_dir_with_options( &self, path: impl AsRef<Path>, options: VisitOptions, ) -> Result<Vec<DirEntry>, VfError>
VfsiExt::read_dirs_with_options with one aggregate budget. Read moreSource§fn read_dirs<P>(&self, paths: &[P]) -> Result<Vec<DirectoryListing>, VfError>
fn read_dirs<P>(&self, paths: &[P]) -> Result<Vec<DirectoryListing>, VfError>
Source§fn read_dirs_with_options<P>(
&self,
paths: &[P],
options: VisitOptions,
) -> Result<Vec<Vec<DirectoryListing>>, VfError>
fn read_dirs_with_options<P>( &self, paths: &[P], options: VisitOptions, ) -> Result<Vec<Vec<DirectoryListing>>, VfError>
Source§fn walk(&self, root: impl AsRef<Path>) -> Result<Vec<DirectoryListing>, VfError>
fn walk(&self, root: impl AsRef<Path>) -> Result<Vec<DirectoryListing>, VfError>
VfsiExt::read_dirs_with_options. Read moreSource§fn walk_with_options(
&self,
path: impl AsRef<Path>,
options: VisitOptions,
) -> Result<Vec<DirectoryListing>, VfError>
fn walk_with_options( &self, path: impl AsRef<Path>, options: VisitOptions, ) -> Result<Vec<DirectoryListing>, VfError>
VfsiExt::read_dirs_with_options with one aggregate budget. Read moreSource§fn visit_dir(
&self,
path: impl AsRef<Path>,
callback: impl FnMut(&DirEntry) -> Result<ControlFlow<()>, VfError>,
) -> Result<TraversalCompletion, VfError>
fn visit_dir( &self, path: impl AsRef<Path>, callback: impl FnMut(&DirEntry) -> Result<ControlFlow<()>, VfError>, ) -> Result<TraversalCompletion, VfError>
Vfsi::vlistdirs. Read moreSource§fn visit_walk(
&self,
root: impl AsRef<Path>,
callback: impl FnMut(&DirEntry) -> Result<ControlFlow<()>, VfError>,
) -> Result<TraversalCompletion, VfError>
fn visit_walk( &self, root: impl AsRef<Path>, callback: impl FnMut(&DirEntry) -> Result<ControlFlow<()>, VfError>, ) -> Result<TraversalCompletion, VfError>
Vfsi::vlistdirs. Read moreSource§fn visit_dir_with_options(
&self,
path: impl AsRef<Path>,
options: VisitOptions,
callback: impl FnMut(&DirEntry) -> Result<ControlFlow<()>, VfError>,
) -> Result<TraversalCompletion, VfError>
fn visit_dir_with_options( &self, path: impl AsRef<Path>, options: VisitOptions, callback: impl FnMut(&DirEntry) -> Result<ControlFlow<()>, VfError>, ) -> Result<TraversalCompletion, VfError>
Vfsi::vlistdirs. Read moreSource§fn visit_entries_with_options<P>(
&self,
paths: &[P],
options: VisitOptions,
callback: impl FnMut(usize, &DirEntry) -> Result<ControlFlow<()>, VfError>,
) -> Result<Vec<TraversalCompletion>, VfError>
fn visit_entries_with_options<P>( &self, paths: &[P], options: VisitOptions, callback: impl FnMut(usize, &DirEntry) -> Result<ControlFlow<()>, VfError>, ) -> Result<Vec<TraversalCompletion>, VfError>
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>
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>
Vfsi::vlistdirs. Keep this helper when those event semantics are required. Read moreSource§fn create_dir(&self, path: impl AsRef<Path>) -> Result<(), VfError>
fn create_dir(&self, path: impl AsRef<Path>) -> Result<(), VfError>
Vfsi::vmkdir. Read moreSource§fn create_dir_all(&self, path: impl AsRef<Path>) -> Result<(), VfError>
fn create_dir_all(&self, path: impl AsRef<Path>) -> Result<(), VfError>
Vfsi::vmkdir; plan missing parents before their children. Read moreSource§fn rename(
&self,
source: impl AsRef<Path>,
destination: impl AsRef<Path>,
) -> Result<(), VfError>
fn rename( &self, source: impl AsRef<Path>, destination: impl AsRef<Path>, ) -> Result<(), VfError>
Vfsi::vrename. Read moreSource§fn copy(
&self,
source: impl AsRef<Path>,
destination: impl AsRef<Path>,
) -> Result<(), VfError>
fn copy( &self, source: impl AsRef<Path>, destination: impl AsRef<Path>, ) -> Result<(), VfError>
Vfsi::vcopy. Read moreSource§fn remove_file(&self, path: impl AsRef<Path>) -> Result<(), VfError>
fn remove_file(&self, path: impl AsRef<Path>) -> Result<(), VfError>
Vfsi::vremove. That vector API accepts both files and directories. Read moreSource§fn remove_dir(&self, path: impl AsRef<Path>) -> Result<(), VfError>
fn remove_dir(&self, path: impl AsRef<Path>) -> Result<(), VfError>
Vfsi::vremove. That vector API does not enforce directory-only inputs. Read moreSource§fn remove_dir_all(&self, path: impl AsRef<Path>) -> Result<(), VfError>
fn remove_dir_all(&self, path: impl AsRef<Path>) -> Result<(), VfError>
Vfsi::vremove with RemoveMode::Tree. Read moreSource§fn remove_dir_contents(&self, path: impl AsRef<Path>) -> Result<(), VfError>
fn remove_dir_contents(&self, path: impl AsRef<Path>) -> Result<(), VfError>
Vfsi::vremove. Read more