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
//! Capability context and scope API.
//!
//! The [`Cx`] type is the capability token that provides access to runtime effects.
//! The [`Scope`] type provides the API for spawning work within a region.
//!
//! All effects in Asupersync flow through explicit capabilities, ensuring
//! no ambient authority exists.
//!
//! # For External Crate Authors
//!
//! If you're building a framework (like fastapi_rust) that depends on Asupersync,
//! the `Cx` type is your primary interface to the runtime. You can:
//!
//! ```ignore
//! use asupersync::Cx;
//!
//! // Wrap Cx in your own context type
//! pub struct RequestContext<'a> {
//! cx: &'a Cx,
//! request_id: u64,
//! }
//!
//! impl<'a> RequestContext<'a> {
//! pub fn new(cx: &'a Cx, request_id: u64) -> Self {
//! Self { cx, request_id }
//! }
//!
//! // Delegate to Cx
//! pub fn is_cancelled(&self) -> bool {
//! self.cx.is_cancel_requested()
//! }
//! }
//! ```
//!
//! # Module Contents
//!
//! - [`Cx`]: The capability context token
//! - [`Scope`]: API for spawning tasks and creating child regions
pub use ;
pub use ;
pub use ;
pub use ;
pub use Scope;
pub use ;