sashite-qi 0.1.0

Qi: an immutable, format-agnostic position model for two-player board games (chess, shogi, xiangqi, and beyond).
Documentation
//! Resource bounds enforced on every position.
//!
//! These caps keep memory bounded even on untrusted input: the dimension count
//! and per-dimension size bound the shape, and the total-square cap bounds the
//! board allocation. They are validated when a position is built, so a caller
//! can construct a `Qi` from external data with no extra sanitization.

/// Maximum number of board dimensions (1D, 2D, or 3D).
pub const MAX_DIMENSIONS: usize = 3;

/// Maximum size of any single dimension.
pub const MAX_DIMENSION_SIZE: usize = 255;

/// Maximum total number of squares on a board.
///
/// Set to `255 * 255 = 65_025`: every square index fits in a `u16`, the bound
/// is far above any real board (chess 64, shōgi 81, xiangqi 90, 3D Raumschach
/// 125), and it caps board allocation well below a megabyte for any fixed-size
/// piece type. A board whose dimensions multiply beyond this is rejected.
pub const MAX_SQUARE_COUNT: usize = 65_025;