Skip to main content

mesh_sieve/topology/
bounds.rs

1//! Common bound aliases used across topology code.
2//!
3//! These traits have blanket impls, so any type satisfying the underlying
4//! bounds will automatically implement them. They are zero-cost and only
5//! reduce duplication in `where` clauses.
6
7/// Canonical bound set for point identifiers.
8///
9/// Rationale:
10/// - `Copy` for cheap pass-by-value in tight loops
11/// - `Eq + Hash` for `HashMap`-backed adjacencies
12/// - `Ord` to allow deterministic ordering (sort strata/neighbors)
13/// - `Debug` for diagnostics and invariant checks
14pub trait PointLike: Copy + Eq + std::hash::Hash + Ord + std::fmt::Debug {}
15impl<T> PointLike for T where T: Copy + Eq + std::hash::Hash + Ord + std::fmt::Debug {}
16
17/// Minimal bound we expect for per-arrow payloads in in-memory backends.
18/// Keep this deliberately small to avoid over-constraining higher layers.
19pub trait PayloadLike: Clone {}
20impl<T: Clone> PayloadLike for T {}