pub struct AsyncCopyOperation { /* private fields */ }Expand description
An owning copy request whose recovery writer remains accessible after failure.
§Examples
This example uses an isolated in-memory provider fixture.
use qubit_fs::Path;
use qubit_fs::copy::CopyOptions;
let mut operation = filesystem.begin_copy(
Path::parse("/source")?, Path::parse("/target")?, CopyOptions::default(),
)?;
let outcome = operation.execute().await?;
assert_eq!(5, outcome.stats().bytes);Implementations§
Source§impl AsyncCopyOperation
impl AsyncCopyOperation
Sourcepub const fn source(&self) -> &Path
pub const fn source(&self) -> &Path
Returns the immutable source path.
§Returns
The source path captured when the operation was created.
Sourcepub const fn state(&self) -> AsyncCopyOperationState
pub const fn state(&self) -> AsyncCopyOperationState
Returns the current operation lifecycle state.
Sourcepub const fn has_recovery(&self) -> bool
pub const fn has_recovery(&self) -> bool
Returns whether a recovery writer is retained by this operation.
Sourcepub fn recovery(&mut self) -> Option<&mut AsyncWriterRecovery>
pub fn recovery(&mut self) -> Option<&mut AsyncWriterRecovery>
Borrows the retained recovery writer, if one exists.
Sourcepub fn take_recovery(&mut self) -> Option<AsyncWriterRecovery>
pub fn take_recovery(&mut self) -> Option<AsyncWriterRecovery>
Takes ownership of the retained recovery writer, if one exists.
Sourcepub async fn execute(&mut self) -> Result<CopyOutcome, AsyncCopyFailure>
pub async fn execute(&mut self) -> Result<CopyOutcome, AsyncCopyFailure>
Executes the operation exactly once.
The operation becomes running only when this future is first polled. Dropping a polled pending future records indeterminate state and does not invoke provider cleanup or start any additional I/O. The deadline includes time spent waiting before execution and is cooperative: a pending provider future is not forcibly woken by this operation, and external cancellation does not roll back provider publication.
§Returns
The provider-confirmed copy outcome.
§Errors
Returns AsyncCopyFailure with the confirmed copy state and any
retained writer when preflight, provider execution, fallback, or
outcome validation fails.