Skip to main content

CopyOptions

Struct CopyOptions 

Source
#[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

Source

pub const fn with_mode(self, mode: CopyMode) -> Self

Returns a copy of these options with the source mode replaced.

Source

pub const fn mode(&self) -> CopyMode

Returns the source interpretation mode.

Source

pub const fn with_conflict(self, conflict: CopyConflictPolicy) -> Self

Returns a copy with the destination conflict policy replaced.

Source

pub const fn conflict(&self) -> CopyConflictPolicy

Returns the destination conflict policy.

Source

pub const fn with_preserve_metadata( self, preserve_metadata: MetadataPreservePolicy, ) -> Self

Returns a copy with the metadata preservation policy replaced.

Source

pub const fn preserve_metadata(&self) -> MetadataPreservePolicy

Returns the metadata preservation policy.

Source

pub const fn with_server_side(self, server_side: ServerSidePreference) -> Self

Returns a copy with the server-side preference replaced.

Source

pub const fn server_side(&self) -> ServerSidePreference

Returns the server-side preference.

Returns a copy with the symbolic-link policy override replaced.

Returns the optional symbolic-link policy override.

Source

pub const fn with_create_parent(self, create: bool) -> Self

Returns a copy with parent creation replaced.

Source

pub const fn create_parent(&self) -> bool

Returns whether missing destination parents are created.

Source

pub const fn with_continue_on_error(self, continue_on_error: bool) -> Self

Returns a copy with continuation policy replaced.

Source

pub const fn continue_on_error(&self) -> bool

Returns whether tree copy continues after per-entry failures.

Source

pub const fn with_atomicity(self, atomicity: AtomicityRequirement) -> Self

Returns a copy with the atomicity requirement replaced.

Source

pub const fn atomicity(&self) -> AtomicityRequirement

Returns the atomicity requirement.

Source

pub const fn with_durability(self, durability: DurabilityRequirement) -> Self

Returns a copy with the durability requirement replaced.

Source

pub const fn durability(&self) -> DurabilityRequirement

Returns the durability requirement.

Source

pub const fn with_max_depth(self, max_depth: Option<usize>) -> Self

Returns a copy with the maximum tree depth replaced.

Source

pub const fn max_depth(&self) -> Option<usize>

Returns the optional maximum tree depth.

Source

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.

Source

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.

Source

pub const fn with_max_bytes(self, max_bytes: Option<u64>) -> Self

Returns a copy with the maximum copied byte count replaced.

Source

pub const fn max_bytes(&self) -> Option<u64>

Returns the optional maximum copied byte count.

Source

pub const fn with_deadline(self, deadline: Option<Duration>) -> Self

Returns a copy with the maximum elapsed duration replaced.

Source

pub const fn deadline(&self) -> Option<Duration>

Returns the optional maximum elapsed duration.

Source

pub fn file() -> Self

Creates options for copying one file-like resource.

§Returns

Copy options with mode set to CopyMode::File.

Source

pub fn tree() -> Self

Creates options for copying a resource tree.

§Returns

Copy options with mode set to CopyMode::Tree.

Source

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.

Trait Implementations§

Source§

impl Clone for CopyOptions

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 Debug for CopyOptions

Source§

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

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

impl Default for CopyOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for CopyOptions

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CopyOptions

Auto Trait Implementations§

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.