#[non_exhaustive]pub struct CopyOptions { /* private fields */ }Expand description
Options controlling file, object, or tree copy operations.
§Examples
use qubit_fs::copy::CopyOptions;
use qubit_fs::copy::ServerSidePreference;
use qubit_fs::metadata::FileSystemCapabilities;
let options = CopyOptions::default().with_server_side(ServerSidePreference::Require);
assert!(options.validate_against(FileSystemCapabilities::new()).is_err());Implementations§
Source§impl CopyOptions
impl CopyOptions
Sourcepub const fn with_mode(self, mode: CopyMode) -> Self
pub const fn with_mode(self, mode: CopyMode) -> Self
Returns a copy of these options with the source mode replaced.
Sourcepub const fn with_conflict(self, conflict: CopyConflictPolicy) -> Self
pub const fn with_conflict(self, conflict: CopyConflictPolicy) -> Self
Returns a copy with the destination conflict policy replaced.
Sourcepub const fn conflict(&self) -> CopyConflictPolicy
pub const fn conflict(&self) -> CopyConflictPolicy
Returns the destination conflict policy.
Sourcepub const fn with_preserve_metadata(
self,
preserve_metadata: MetadataPreservePolicy,
) -> Self
pub const fn with_preserve_metadata( self, preserve_metadata: MetadataPreservePolicy, ) -> Self
Returns a copy with the metadata preservation policy replaced.
Sourcepub const fn preserve_metadata(&self) -> MetadataPreservePolicy
pub const fn preserve_metadata(&self) -> MetadataPreservePolicy
Returns the metadata preservation policy.
Sourcepub const fn with_server_side(self, server_side: ServerSidePreference) -> Self
pub const fn with_server_side(self, server_side: ServerSidePreference) -> Self
Returns a copy with the server-side preference replaced.
Sourcepub const fn server_side(&self) -> ServerSidePreference
pub const fn server_side(&self) -> ServerSidePreference
Returns the server-side preference.
Sourcepub const fn with_symlink_policy(self, policy: SymlinkPolicy) -> Self
pub const fn with_symlink_policy(self, policy: SymlinkPolicy) -> Self
Returns a copy with the symbolic-link policy override replaced.
Sourcepub const fn symlink_policy_override(&self) -> Option<SymlinkPolicy>
pub const fn symlink_policy_override(&self) -> Option<SymlinkPolicy>
Returns the optional symbolic-link policy override.
Sourcepub const fn with_create_parent(self, create: bool) -> Self
pub const fn with_create_parent(self, create: bool) -> Self
Returns a copy with parent creation replaced.
Sourcepub const fn create_parent(&self) -> bool
pub const fn create_parent(&self) -> bool
Returns whether missing destination parents are created.
Sourcepub const fn with_continue_on_error(self, continue_on_error: bool) -> Self
pub const fn with_continue_on_error(self, continue_on_error: bool) -> Self
Returns a copy with continuation policy replaced.
Sourcepub const fn continue_on_error(&self) -> bool
pub const fn continue_on_error(&self) -> bool
Returns whether tree copy continues after per-entry failures.
Sourcepub const fn with_atomicity(self, atomicity: AtomicityRequirement) -> Self
pub const fn with_atomicity(self, atomicity: AtomicityRequirement) -> Self
Returns a copy with the atomicity requirement replaced.
Sourcepub const fn atomicity(&self) -> AtomicityRequirement
pub const fn atomicity(&self) -> AtomicityRequirement
Returns the atomicity requirement.
Sourcepub const fn with_durability(self, durability: DurabilityRequirement) -> Self
pub const fn with_durability(self, durability: DurabilityRequirement) -> Self
Returns a copy with the durability requirement replaced.
Sourcepub const fn durability(&self) -> DurabilityRequirement
pub const fn durability(&self) -> DurabilityRequirement
Returns the durability requirement.
Sourcepub const fn with_max_depth(self, max_depth: Option<usize>) -> Self
pub const fn with_max_depth(self, max_depth: Option<usize>) -> Self
Returns a copy with the maximum tree depth replaced.
Sourcepub const fn with_max_entries(self, max_entries: Option<usize>) -> Self
pub const fn with_max_entries(self, max_entries: Option<usize>) -> Self
Returns a copy with the maximum source entry count replaced.
Some(0) rejects every copy because even a file-mode copy consumes one
source entry. For tree copies, the limit applies to the aggregate of
files, directories, symbolic links, objects, and prefixes.
Sourcepub const fn max_entries(&self) -> Option<usize>
pub const fn max_entries(&self) -> Option<usize>
Returns the optional maximum source entry count.
None leaves the entry count unbounded. The count includes every
source resource represented in the completed
CopyOutcome statistics, including
directories and prefixes.
Sourcepub const fn with_max_bytes(self, max_bytes: Option<u64>) -> Self
pub const fn with_max_bytes(self, max_bytes: Option<u64>) -> Self
Returns a copy with the maximum copied byte count replaced.
Sourcepub const fn with_deadline(self, deadline: Option<Duration>) -> Self
pub const fn with_deadline(self, deadline: Option<Duration>) -> Self
Returns a copy with the maximum elapsed duration replaced.
Sourcepub const fn deadline(&self) -> Option<Duration>
pub const fn deadline(&self) -> Option<Duration>
Returns the optional maximum elapsed duration.
Sourcepub fn file() -> Self
pub fn file() -> Self
Creates options for copying one file-like resource.
§Returns
Copy options with mode set to CopyMode::File.
Sourcepub fn validate_against(
&self,
capabilities: FileSystemCapabilities,
) -> Result<(), FsError>
pub fn validate_against( &self, capabilities: FileSystemCapabilities, ) -> Result<(), FsError>
Validates required copy semantics before provider side effects.
Preferred server-side copy may fall back and report its actual method. Required server-side copy must fail this preflight when the configured filesystem does not guarantee it.
§Errors
Returns FsErrorKind::RequirementNotMet with
FileSystemCapability::ServerSideCopy when required server-side copy
is unavailable.