#geometry #integer #rect #2d #compatible #no-std

ixy

A minimal, no-std compatible crate for 2D integer geometry

14 releases (6 breaking)

Uses new Rust 2024

0.6.0-alpha.3 Aug 5, 2025
0.5.7 Aug 1, 2025
0.5.6 Jul 30, 2025

#2328 in Algorithms

Download history

855 downloads per month
Used in 2 crates (via grixy)

MIT license

125KB
3K SLoC

A terse, no-std crate for 2D integer geometry.

Examples

use ixy::{Pos, Rect};

let pos = Pos::new(10, 20);
let rect = Rect::from_ltwh(0, 0, 100, 200);

assert_eq!(pos.x, 10);
assert_eq!(pos.y, 20);
assert_eq!(rect.left(), 0);
assert_eq!(rect.top(), 0);
assert_eq!(rect.width(), 100);
assert_eq!(rect.height(), 200);
assert_eq!(rect.right(), 100);
assert_eq!(rect.bottom(), 200);
assert!(rect.contains_pos(pos));
assert!(!rect.contains_pos(Pos::new(150, 250)));

ixy

A minimal, no-std compatible crate for 2D integer geometry

Test Crates.io Version codecov

Contributing

This project uses just to run commands the same way as the CI:

  • cargo just check to check formatting and lints.
  • cargo just coverage to generate and preview code coverage.
  • cargo just doc to generate and preview docs.
  • cargo just test to run tests.

For a full list of commands, see the Justfile.

Inspiration

No runtime deps