Expand description
Branded (phantom-typed) index types for type-safe collection access.
Index<T> wraps a usize with a phantom type parameter T so that
indices into different collections cannot be accidentally mixed at
compile time.
§Why No Default?
Index 0 is valid data (the first element), not a sentinel value.
Providing Default would invite bugs where an “uninitialized” index
silently points at element 0.
§Examples
use hwpforge_foundation::CharShapeIndex;
let idx = CharShapeIndex::new(3);
assert_eq!(idx.get(), 3);
// Bounds checking
assert!(idx.checked_get(10).is_ok());
assert!(idx.checked_get(2).is_err());Structs§
- Border
Fill Marker - Phantom marker for border/fill indices.
- Char
Shape Marker - Phantom marker for character shape indices.
- Font
Marker - Phantom marker for font indices.
- Index
- A branded index into a typed collection.
- Numbering
Marker - Phantom marker for numbering definition indices.
- Para
Shape Marker - Phantom marker for paragraph shape indices.
- Style
Marker - Phantom marker for style indices.
- TabMarker
- Phantom marker for tab property indices.
Type Aliases§
- Border
Fill Index - Index into a border/fill collection.
- Char
Shape Index - Index into a character shape collection.
- Font
Index - Index into a font collection.
- Numbering
Index - Index into the numbering definition list.
- Para
Shape Index - Index into a paragraph shape collection.
- Style
Index - Index into a style collection.
- TabIndex
- Index into the tab properties list.