devela/work/sync/
reexports.rs

1// devela::work::sync::reexports
2//
3//! Reexported items.
4//
5// WAIT: [unique_rc_arc](https://github.com/rust-lang/rust/issues/112566)
6
7use crate::reexport;
8
9/* from either `alloc` or `portable-atomic-util` */
10
11#[doc = crate::TAG_ATOMIC!()]
12#[doc = crate::TAG_ATOMIC_ALLOC_PORTABLE_UTIL!()]
13#[doc = "A thread-safe reference-counting pointer.\n\n"]
14#[cfg(all(feature = "alloc", feature = "dep_portable_atomic_util"))]
15#[cfg_attr(feature = "nightly_doc", doc(cfg(feature = "alloc")))]
16pub use crate::_dep::portable_atomic_util::Arc;
17//
18#[doc = crate::TAG_ATOMIC!()]
19#[doc = crate::TAG_ATOMIC_ALLOC_PORTABLE_UTIL!()]
20#[doc = "A thread-safe reference-counting pointer.\n\n"]
21#[cfg(all(feature = "alloc", not(feature = "dep_portable_atomic_util")))]
22#[cfg_attr(feature = "nightly_doc", doc(cfg(feature = "alloc")))]
23pub use crate::_dep::_alloc::sync::Arc;
24
25#[doc = crate::TAG_ATOMIC!()]
26#[doc = crate::TAG_ATOMIC_ALLOC_PORTABLE_UTIL!()]
27#[doc = "A version of [`Arc`] that holds a non-owning reference.\n\n"]
28#[cfg(all(feature = "alloc", feature = "dep_portable_atomic_util"))]
29#[cfg_attr(feature = "nightly_doc", doc(cfg(feature = "alloc")))]
30pub use crate::_dep::portable_atomic_util::Weak as ArcWeak;
31//
32#[doc = crate::TAG_ATOMIC!()]
33#[doc = crate::TAG_ATOMIC_ALLOC_PORTABLE_UTIL!()]
34#[doc = "A version of [`Arc`] that holds a non-owning reference to the managed allocation.\n\n"]
35#[cfg(all(feature = "alloc", not(feature = "dep_portable_atomic_util")))]
36#[cfg_attr(feature = "nightly_doc", doc(cfg(feature = "alloc")))]
37pub use crate::_dep::_alloc::sync::Weak as ArcWeak;
38
39/* `std` structs */
40
41reexport! { rust: std::sync,
42    doc: "Enables multiple threads to synchronize the beginning of some computation.",
43    Barrier
44}
45reexport! { rust: std::sync,
46    tag: crate::TAG_RESULT!(),
47    doc: "Returned by [`Barrier::wait()`] when all threads in the Barrier have rendezvoused.",
48    BarrierWaitResult
49}
50reexport! { rust: std::sync,
51    doc: "A Condition Variable",
52    Condvar
53}
54reexport! { rust: std::sync,
55    doc: "A value which is initialized on the first access.",
56    LazyLock
57}
58reexport! { rust: std::sync,
59    doc: "A mutual exclusion primitive useful for protecting shared data.",
60    Mutex
61}
62reexport! { rust: std::sync,
63    doc: "An RAII implementation of a “scoped lock” of a mutex.",
64    MutexGuard
65}
66reexport! { rust: std::sync,
67    doc: "A synchronization primitive for one-time global initialization.",
68    Once
69}
70reexport! { rust: std::sync,
71    doc: "A synchronization primitive which can be written to only once.",
72    OnceLock
73}
74reexport! { rust: std::sync,
75    doc: "State yielded to [`Once::call_once_force()`]’s closure parameter.",
76    OnceState
77}
78reexport! { rust: std::sync,
79    tag: crate::TAG_ERROR!(),
80    doc: "A type of error which can be returned whenever a lock is acquired.",
81    PoisonError
82}
83reexport! { rust: std::sync,
84    doc: "A reader-writer lock",
85    RwLock
86}
87reexport! { rust: std::sync,
88    doc: "RAII structure used to release the shared read access of a lock when dropped.",
89    RwLockReadGuard
90}
91reexport! { rust: std::sync,
92    doc: "RAII structure used to release the exclusive write access of a lock when dropped.",
93    RwLockWriteGuard
94}
95reexport! { rust: std::sync,
96    tag: crate::TAG_RESULT!(),
97    doc: "Whether a timed wait on a condition variable returned due to a time out or not.",
98    WaitTimeoutResult
99}
100
101/* `std` enums */
102
103reexport! { rust: std::sync,
104    tag: crate::TAG_ERROR_COMPOSITE!(),
105    doc: "An enumeration of possible errors associated with a [`TryLockResult`].",
106    TryLockError
107}
108
109/* `std` aliases */
110
111reexport! { rust: std::sync,
112    tag: crate::TAG_RESULT!(),
113    doc: "A type alias for the result of a lock method which can be poisoned.",
114    LockResult
115}
116reexport! { rust: std::sync,
117    tag: crate::TAG_RESULT!(),
118    doc: "A type alias for the result of a nonblocking locking method.",
119    TryLockResult
120}