Trait ValidKey

Source
pub trait ValidKey<Coor>:
    PrimInt
    + From<Coor>
    + BitOrAssign
    + BitAndAssign
    + ShlAssign<usize> { }
Expand description

Guarantees that a given data structure is suitable for a Morton Key.

Essentially, it guarantees that a) it behaves as if it’s an integer and b) that it’s larger than the relevant coordinate.

Ideally, we would also like a const N: usize here that would assert that a Key value is at least N times larger than a Coor value, but as of current (1.50) Rust this is not possible.

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.

Implementors§

Source§

impl<Coor, Key: PrimInt + From<Coor> + BitOrAssign + BitAndAssign + ShlAssign<usize>> ValidKey<Coor> for Key

All primitive int types are suitable for Morton Keys.