Skip to main content

Crate auralis_signal

Crate auralis_signal 

Source
Expand description

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 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);

Macros§

memo
Create a Memo with automatic clone of captured identifiers.

Structs§

FilterChangedFuture
A Future that yields a new signal value only when it satisfies a predicate.
MapChangedFuture
A Future that transforms each new signal value through a mapping function.
Memo
A lazy, auto-tracking computed signal.
Signal
A reactive value container with monotonic version tracking.
SignalChangedFuture
A Future that completes with the signal’s current value on the next mutation.
SignalMap
A lightweight read-only projection of a Signal.

Functions§

batch
Run f in a batch context.
in_batch
Return true if currently inside a batch context.