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
72
73
74
75
76
77
78
//! auralis-signal: Reactive signal primitive with version tracking and
//! proactive waker deregistration.
//!
//! # Overview
//!
//! This crate provides [`Signal<T>`] and [`Memo<T>`] — the foundational
//! reactive primitives of the Auralis kernel. Every signal carries a
//! monotonic version number. When a change-detection future is dropped
//! before resolution, it eagerly removes its waker from the signal's
//! internal list, preventing stale-waker accumulation (the "proactive
//! deregistration" guarantee).
//!
//! The crate is **zero-dependency**, **`#![forbid(unsafe_code)]`**, and
//! intentionally single-threaded (`!Send` / `!Sync`). See the
//! [repository design docs](https://github.com/user/auralis) for the
//! rationale behind those choices.
//!
//! # Quick example
//!
//! ```
//! use auralis_signal::Signal;
//!
//! let sig = Signal::new(0);
//! sig.set(1);
//! assert_eq!(sig.read(), 1);
//! ```
/// Create a [`Memo`] with automatic clone of captured identifiers.
///
/// Instead of manually cloning every signal before the `move` closure:
///
/// ```
/// use auralis_signal::{Signal, Memo};
///
/// let a = Signal::new(1);
/// let b = Signal::new(2);
///
/// // Without the macro:
/// let sum = Memo::new({
/// let a = a.clone();
/// let b = b.clone();
/// move || a.read() + b.read()
/// });
///
/// // With the macro:
/// let sum = auralis_signal::memo!(a, b => a.read() + b.read());
/// ```
///
/// The macro expands to the same pattern — a `move` closure with each
/// captured identifier cloned into a local variable of the same name.
pub use ;
pub use ;
pub use Memo;
pub use ;
pub use ;
pub use ;