zoc/
lib.rs

1//! This crate contains a simple implementation of [Z-order curves][1] along
2//! with `litmax` and `bigmin` calculations as described in the paper
3//! ["Multidimensional Range Search in Dynamically Balanced Trees"][2] by H. Tropf
4//! and H. Herzog (Angewandte Informatik 2/1981, pp. 71-77).
5//!
6//! [1]: https://en.wikipedia.org/wiki/Z-order_curve
7//! [2]: http://www.vision-tools.com/h-tropf/multidimensionalrangequery.pdf
8
9#![forbid(unsafe_code)]
10
11mod z;
12mod size;
13
14pub mod search;
15
16pub use z::{Bbox, Z};
17pub use size::Size;
18
19/// A type that has a [`Z`] value.
20pub trait GetZ<const D: usize, T: Size<D>> {
21    fn z(&self) -> &Z<D, T>;
22}
23
24impl<const D: usize, T: Size<D>> GetZ<D, T> for Z<D, T> {
25    fn z(&self) -> &Z<D, T> {
26        self
27    }
28}