CopyStrategy
How to perform copies. Currently only relevant to directory level copies when using copyItem(at:to:strategy:shouldProceedAfterError:shouldCopyItem:)
or other overloads that use the default behaviour.
struct CopyStrategy
How to perform copies. Currently only relevant to directory level copies when using copyItem(at:to:strategy:shouldProceedAfterError:shouldCopyItem:)
or other overloads that use the default behaviour.
struct CopyStrategy
import _NIOFileSystem
A file system library for Swift.
func copyItem(at sourcePath: FilePath, to destinationPath: FilePath, strategy copyStrategy: CopyStrategy, shouldProceedAfterError: @escaping (_ source: DirectoryEntry, _ error: Error) async throws -> Void, shouldCopyItem: @escaping (_ source: DirectoryEntry, _ destination: FilePath) async -> Bool) async throws
Copies the item at the specified path to a new location.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Sendable
static let platformDefault: Self
Operate in whatever manner is deemed a reasonable default for the platform. This will limit the maximum file descriptors usage based on reasonable defaults.
static let sequential: Self
The copy is done asynchronously, but only one operation will occur at a time. This is the only way to guarantee only one callback to the shouldCopyItem
will happen at a time.
static func parallel(maxDescriptors: Int) throws -> CopyStrategy
Allow multiple I/O operations to run concurrently, including file copies/directory creation and scanning.
var description: String { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.