trait Coordinates {
// Required methods
fn set_coord(&mut self, depth: usize, value: i32);
fn truncate_to(&mut self, depth: usize);
fn get(&self) -> Self;
}Expand description
Trait for managing coordinates during iteration.
The iterator accumulates coordinates dimension-by-dimension as it descends. When it backtracks,
it calls truncate_to to discard coordinates from deeper
dimensions. When it yields an entry, it calls get to snapshot the current
coordinates.
Required Methods§
Sourcefn set_coord(&mut self, depth: usize, value: i32)
fn set_coord(&mut self, depth: usize, value: i32)
Sets the coordinate at the given depth (dimension index) to value.
Sourcefn truncate_to(&mut self, depth: usize)
fn truncate_to(&mut self, depth: usize)
Discards any coordinate data beyond depth, preparing for backtracking.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<const K: usize> Coordinates for [i32; K]
Fixed-size coordinate accumulator for MultiIndexed.
impl<const K: usize> Coordinates for [i32; K]
Fixed-size coordinate accumulator for MultiIndexed.
truncate_to is a no-op since all dimensions are always present in the array; stale values at
deeper indices are simply overwritten by set_coord before they are ever read.