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
//! Small, reusable Rust building blocks, extracted from a binary-analysis
//! toolchain and kept dependency-light.
//!
//! - [`registry`] — strongly typed `usize` identifiers ([`Identifier`]) and
//! id-indexed registries, so a `NodeId` cannot be passed where an `EdgeId`
//! belongs.
//! - [`graph`] — directed graph containers, plus [`graph::analysis`] for
//! dominator and post-dominator trees and canonical edge-based SESE
//! (single-entry/single-exit) region decomposition.
//! - [`stable_arena`] — an arena whose elements keep their address as it grows.
//! - [`intern`] — string interning.
//! - [`num_ref`] — small numeric reference helpers.
//!
//! Layered graph *layout* lives in the separate `wazabin-triskel` crate, which
//! builds on [`graph`].
extern crate self as jstd;
/// Derive macro for strongly typed `usize` identifiers.
///
/// This derive is intended for tuple newtypes with exactly one `usize` field,
/// and generates implementations for:
/// - `Copy`, `Clone`, `Debug`, `Default`, `PartialEq`, `Eq`, `Hash`
/// - `From<usize>` and `From<Self> for usize`
/// - [`registry::Identifier`]
///
/// # Example
/// ```
/// use jstd::Identifier;
///
/// #[derive(Identifier)]
/// pub struct MyId(usize);
///
/// let id = MyId::from(42usize);
/// let raw: usize = id.into();
/// assert_eq!(raw, 42);
/// assert_eq!(MyId::default(), MyId::from(0usize));
/// ```
pub use Identifier;