subetha_core/lib.rs
1//! Substrate for adaptive primitives.
2//!
3//! The four core abstractions actually consumed by the IPC stack:
4//!
5//! - [`HandshakeHeader`] - per-instance generation counter and in-flight tracker.
6//! - [`ObservationRing`] - TLS-local ring buffer for op observations.
7//! - [`migration`] - dual-stack migration protocol primitives.
8//! - [`Marshal`] - type-system contract for "this value can cross an
9//! address-space boundary byte-identically." Stricter than `Send`;
10//! required by every cross-process primitive in `subetha-cxc` that
11//! stores typed values (e.g. `SharedDeque<T>`).
12//!
13//! Plus the architecture catalog ([`Axis`] / [`AxisMask`]) for direction
14//! signatures and the [`cpuid`] helpers for CPU-feature detection.
15//!
16//! Every adaptive primitive in `subetha-pointers` and `subetha-cxc`
17//! carries a `HandshakeHeader` at a known offset.
18
19#![forbid(unsafe_op_in_unsafe_fn)]
20
21// The crate links std: the per-thread sequential id machinery in
22// [`observation::thread_id`] needs `thread_local!`.
23
24pub mod axis_signature;
25pub mod cpuid;
26pub mod handshake;
27pub mod marshal;
28pub mod migration;
29pub mod observation;
30
31pub use axis_signature::{Axis, AxisMask, Fusion};
32pub use cpuid::{has_movdir64b, has_waitpkg};
33pub use handshake::HandshakeHeader;
34pub use marshal::{Marshal, MarshalError};
35pub use migration::{Generation, MigrationGuard};
36pub use observation::{Observation, ObservationRing, any_observer_armed, thread_id};