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
//! Link type for modulink-rust
//! Pure function: async closure, takes Context and returns Context.
//!
//! # Shadowing Policy (Ergonomic APIs)
//! For ergonomic usage (`Link`), always use variable shadowing (e.g., `let ctx = ...`) instead of `mut`.
//! This prevents accidental mutation and is safer for async/concurrent code. See migration plan for details.
//!
//! Example (ergonomic, shadowing):
//! ```rust
//! use modulink_rs::context::Context;
//! let ctx = Context::new();
//! let ctx = ctx.insert("a", 1);
//! let ctx = ctx.insert("b", 2);
//! ```
//!
//! Advanced/generic links may use `mut` for performance, but must document the tradeoff.
use crateContext;
use Future;
use Pin;
use Arc;
/// The generic async link type for any context.
pub type LinkGeneric<C> = ;
/// The ergonomic link type alias for Context.
/// For backward compatibility and ergonomic usage, export as Link.
pub type Link = ;
// --- Core API Exports ---
// Context is re-exported from crate::context
// Link and LinkErgonomic are defined above
// Chain, Middleware, Listener will be re-exported from their respective modules
pub use crateChain;
pub use crateMiddleware;
// Listener system: ergonomic exports for sync and async listeners
pub use crateListenerSync;
pub use crateListenerAsync;