Skip to main content

AsyncCopyOperation

Struct AsyncCopyOperation 

Source
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

Source

pub const fn source(&self) -> &Path

Returns the immutable source path.

§Returns

The source path captured when the operation was created.

Source

pub const fn target(&self) -> &Path

Returns the immutable destination path.

Source

pub const fn state(&self) -> AsyncCopyOperationState

Returns the current operation lifecycle state.

Source

pub const fn has_recovery(&self) -> bool

Returns whether a recovery writer is retained by this operation.

Source

pub fn recovery(&mut self) -> Option<&mut AsyncWriterRecovery>

Borrows the retained recovery writer, if one exists.

Source

pub fn take_recovery(&mut self) -> Option<AsyncWriterRecovery>

Takes ownership of the retained recovery writer, if one exists.

Source

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.

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> 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, 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.