clockwork_tuples/lib.rs
1#![deny(missing_docs)]
2
3//! Tuple-oriented type-level utilities.
4//!
5//! This crate provides traits and helpers for reasoning about and
6//! manipulating tuple types at the type level. It is intended for
7//! library consumers that need compile-time guarantees over tuple
8//! structure, ordering, and containment.
9//!
10//! # Guarantees
11//!
12//! - All public traits define structural properties of tuple types.
13//! - No runtime allocation is performed by this crate.
14//! - APIs are pure with respect to observable runtime state.
15//!
16//! # Examples
17//! ```
18//! use clockwork_tuples::traits::{as_cons_tuple::AsConsTuple, has::Has};
19//!
20//! fn foo() {
21//! let tuple = ("alpha", 7u8, true);
22//!
23//! // Convert the tuple into a cons-style representation for structural recursion.
24//! let cons = tuple.to_cons_tuple();
25//! assert_eq!(cons.0, "alpha");
26//! assert_eq!(cons.1.0, 7u8);
27//! assert!(cons.1.1.0);
28//!
29//! // Navigate to the boolean
30//! let val: bool = tuple.get();
31//! assert!(val);
32//! }
33//! ```
34
35pub mod index;
36pub(crate) mod macros;
37pub mod traits;