1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// =============================================================================
// Copyright (c) 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Stage-aware asynchronous copy cancellation probes.
use Context;
use Poll;
use crateAsyncCopyFixtureCase;
use crateFixtureResult;
/// Observes and controls one provider-owned pending copy stage.
///
/// # Context
///
/// A fixture returns this probe from
/// [`crate::AsyncFileSystemFixture::prepare_copy_cancellation`] after arming
/// the requested stage. The copy execution future must be dropped before
/// calling [`disarm`](Self::disarm), so the provider stops using the gate
/// before it is released.
///
/// # Polling
///
/// [`poll_reached`](Self::poll_reached) returns `Poll::Pending` until the
/// provider reaches the requested stage. Before returning `Pending`, it must
/// arrange to wake the supplied task when the stage becomes observable.
/// `Poll::Ready(Ok(()))` confirms that the stage is gated, and
/// `Poll::Ready(Err(_))` reports that the fixture could not confirm it.
///
/// # Errors
///
/// `poll_reached` returns a fixture error when stage acknowledgement fails.
/// `disarm` returns a fixture error when the gate cannot be released. The
/// probe must release the gate even when reporting a disarm error, so fixture
/// teardown can safely continue.
///
/// # Examples
///
/// The execution future must already have been dropped before this function
/// is called.
///
/// ```
/// use qubit_fs_testkit::CopyCancellationProbe;
/// use qubit_fs_testkit::FixtureResult;
///
/// fn release_after_execution_is_dropped(probe: &dyn CopyCancellationProbe) -> FixtureResult<()> {
/// let case = probe.case();
/// assert_ne!(case.source(), case.target());
/// probe.disarm()?;
/// Ok(())
/// }
/// ```