pub trait OptimizedFs {
// Required methods
fn optimized_copy(
&mut self,
src: PathBuf,
dst: PathBuf,
src_file_size: u64,
target_label: String,
buffer_limit: Option<usize>,
skip_fsync: bool,
is_sparse: bool,
) -> impl Future<Output = Result<CopyStats>> + Send;
fn optimized_copy_range(
&mut self,
src: PathBuf,
dst: PathBuf,
offset: u64,
length: u64,
src_file_size: u64,
target_label: String,
buffer_limit: Option<usize>,
skip_fsync: bool,
) -> impl Future<Output = Result<CopyStats>> + Send;
fn optimized_truncate(
&mut self,
dst: PathBuf,
size: u64,
) -> impl Future<Output = Result<CopyStats>> + Send;
fn optimized_rename(
&mut self,
src: PathBuf,
dst: PathBuf,
flags: u32,
) -> impl Future<Output = Result<CopyStats>> + Send;
fn optimized_fallocate(
&mut self,
dst: PathBuf,
mode: i32,
offset: u64,
length: u64,
) -> impl Future<Output = Result<CopyStats>> + Send;
fn optimized_unlink(
&mut self,
path: PathBuf,
is_dir: bool,
) -> impl Future<Output = Result<CopyStats>> + Send;
fn optimized_link(
&mut self,
existing: PathBuf,
new: PathBuf,
) -> impl Future<Output = Result<CopyStats>> + Send;
fn optimized_symlink(
&mut self,
target: PathBuf,
linkpath: PathBuf,
) -> impl Future<Output = Result<CopyStats>> + Send;
}Expand description
Trait for filesystem operations that auto-select the optimal I/O path
Required Methods§
Sourcefn optimized_copy(
&mut self,
src: PathBuf,
dst: PathBuf,
src_file_size: u64,
target_label: String,
buffer_limit: Option<usize>,
skip_fsync: bool,
is_sparse: bool,
) -> impl Future<Output = Result<CopyStats>> + Send
fn optimized_copy( &mut self, src: PathBuf, dst: PathBuf, src_file_size: u64, target_label: String, buffer_limit: Option<usize>, skip_fsync: bool, is_sparse: bool, ) -> impl Future<Output = Result<CopyStats>> + Send
Copy an entire file, choosing reflink/sendfile/io_uring as appropriate
Sourcefn optimized_copy_range(
&mut self,
src: PathBuf,
dst: PathBuf,
offset: u64,
length: u64,
src_file_size: u64,
target_label: String,
buffer_limit: Option<usize>,
skip_fsync: bool,
) -> impl Future<Output = Result<CopyStats>> + Send
fn optimized_copy_range( &mut self, src: PathBuf, dst: PathBuf, offset: u64, length: u64, src_file_size: u64, target_label: String, buffer_limit: Option<usize>, skip_fsync: bool, ) -> impl Future<Output = Result<CopyStats>> + Send
Copy a byte range within a file (used for Merkle delta resync)
Sourcefn optimized_truncate(
&mut self,
dst: PathBuf,
size: u64,
) -> impl Future<Output = Result<CopyStats>> + Send
fn optimized_truncate( &mut self, dst: PathBuf, size: u64, ) -> impl Future<Output = Result<CopyStats>> + Send
Truncate a file to the given size
Sourcefn optimized_rename(
&mut self,
src: PathBuf,
dst: PathBuf,
flags: u32,
) -> impl Future<Output = Result<CopyStats>> + Send
fn optimized_rename( &mut self, src: PathBuf, dst: PathBuf, flags: u32, ) -> impl Future<Output = Result<CopyStats>> + Send
Rename a file with optional flags (e.g. RENAME_EXCHANGE)
Sourcefn optimized_fallocate(
&mut self,
dst: PathBuf,
mode: i32,
offset: u64,
length: u64,
) -> impl Future<Output = Result<CopyStats>> + Send
fn optimized_fallocate( &mut self, dst: PathBuf, mode: i32, offset: u64, length: u64, ) -> impl Future<Output = Result<CopyStats>> + Send
Allocate or punch holes in a file
Sourcefn optimized_unlink(
&mut self,
path: PathBuf,
is_dir: bool,
) -> impl Future<Output = Result<CopyStats>> + Send
fn optimized_unlink( &mut self, path: PathBuf, is_dir: bool, ) -> impl Future<Output = Result<CopyStats>> + Send
Unlink a file or remove a directory via io_uring UnlinkAt (AT_REMOVEDIR for dirs). Falls back to spawn_blocking on EOPNOTSUPP.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.