reify_reflect/lib.rs
1#![deny(unsafe_code)]
2
3//! # reify-reflect
4//!
5//! Unified reification and reflection ecosystem for Rust.
6//!
7//! This facade crate re-exports the core components of the ecosystem:
8//!
9//! - [`core`]: `Reflect` trait, `reify` function, `Reified` token, `RuntimeValue` enum
10//! - [`nat`]: type-level naturals, booleans, and heterogeneous lists
11//! - [`derive`](reflect_derive): `#[derive(Reflect)]` proc macro
12//! - [`graph`]: `Rc`/`Arc` graph reification and reconstruction
13//! - [`context`]: runtime-synthesized trait instances
14//! - [`async_trace`]: async computation step graph extraction
15//! - [`const_bridge`]: runtime-to-const-generic dispatch (behind `const-reify` feature)
16//!
17//! # Feature Flags
18//!
19//! - `serde` *(default)*: enables serde support for `reify-graph` and `async-reify`
20//! - `const-reify`: enables the `const_bridge` module for runtime-to-const-generic dispatch
21//! - `full`: enables all features
22//!
23//! # Quick Start
24//!
25//! ```
26//! use reify_reflect::core::{Reflect, RuntimeValue};
27//! use reify_reflect::nat::{S, Z};
28//!
29//! type Three = S<S<S<Z>>>;
30//! assert_eq!(Three::reflect(), RuntimeValue::Nat(3));
31//! ```
32
33/// Core traits and types: [`Reflect`](reify_reflect_core::Reflect),
34/// [`reify`](reify_reflect_core::reify), [`Reified`](reify_reflect_core::Reified),
35/// [`RuntimeValue`](reify_reflect_core::RuntimeValue).
36pub mod core {
37 pub use reify_reflect_core::*;
38}
39
40/// Type-level naturals ([`Z`](reflect_nat::Z), [`S`](reflect_nat::S)),
41/// booleans ([`True`](reflect_nat::True), [`False`](reflect_nat::False)),
42/// and heterogeneous lists ([`HNil`](reflect_nat::HNil), [`HCons`](reflect_nat::HCons)).
43pub mod nat {
44 pub use reflect_nat::*;
45}
46
47/// `Rc<RefCell<T>>` graph reification and reconstruction.
48pub mod graph {
49 pub use reify_graph::*;
50}
51
52/// Runtime-synthesized trait instances scoped to callbacks.
53pub mod context {
54 pub use context_trait::*;
55}
56
57/// Async computation tracing and step graph extraction.
58pub mod async_trace {
59 pub use async_reify::*;
60}
61
62/// Runtime-to-const-generic dispatch (requires `const-reify` feature).
63#[cfg(feature = "const-reify")]
64pub mod const_bridge {
65 pub use const_reify::*;
66}