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) 2025-2026 Takayuki Sato. All Rights Reserved.
// This program is free software under MIT License.
// See the file LICENSE in this distribution for more details.
use ;
/// A `PhasedCell` that supports graceful cleanup and graceful read.
///
/// This cell extends [`PhasedCell`](crate::PhasedCell) with two main capabilities:
/// 1. **Graceful Cleanup**: It ensures that all ongoing read operations complete before allowing
/// the cell to fully transition to the `Cleanup` phase.
/// 2. **Graceful Read**: If a read operation is attempted while the cell is in the
/// `Setup` phase and transitioning to `Read`, the read operation
/// will wait for the transition to complete and for the cell to enter the `Read` phase.
///
/// Like `PhasedCell`, this cell is `Sync` if the contained data `T` is `Send + Sync`.
/// A thread-safe `PhasedCellSync` that supports graceful cleanup and graceful read.
///
/// This cell is the thread-safe counterpart to [`GracefulPhasedCell`], building upon
/// [`PhasedCellSync`](crate::PhasedCellSync). It offers:
/// 1. **Graceful Cleanup**: It ensures that all ongoing read operations complete before allowing
/// the cell to fully transition to the `Cleanup` phase.
/// 2. **Graceful Read**: If a read operation is attempted while the cell is in the
/// `Setup` phase and transitioning to `Read`, the read operation
/// will wait for the transition to complete and for the cell to enter the `Read` phase.
/// An asynchronous, thread-safe `PhasedCellAsync` that supports graceful cleanup and graceful read.
///
/// This cell is the asynchronous version of [`GracefulPhasedCellSync`], designed for
/// `tokio`-based applications and building upon [`PhasedCellAsync`](crate::PhasedCellAsync).
/// It provides:
/// 1. **Graceful Cleanup**: It ensures that all ongoing read operations complete before allowing
/// the cell to fully transition to the `Cleanup` phase.
/// 2. **Graceful Read**: If a read operation is attempted while the cell is in the
/// `Setup` phase and transitioning to `Read`, the read operation
/// will wait for the transition to complete and for the cell to enter the `Read` phase.