pub trait Quantum: Copy + Clone + From<u32> + PartialEq<Self> + Eq + PartialOrd<Self> + Ord + Debug {
    type Absolute;

    fn inner(&self) -> u32;
    fn dimension(topo: &Topology) -> &Dimension;
    fn normalized(self, topo: &Topology) -> Self;

    fn max_value(topo: &Topology) -> Self { ... }
    fn exp_wrapping(&self, topo: &Topology, pow: u8) -> u32 { ... }
    fn wrapping_add(self, other: u32) -> Self { ... }
    fn wrapping_sub(self, other: u32) -> Self { ... }
}
Expand description

A quantum in the physical sense: the smallest possible amount of something. Here, we are talking about Time and Space quanta.

Required Associated Types§

The absolute coordinate which this quantum corresponds to (time or space)

Required Methods§

The u32 representation

Return the proper dimension (time or space) from the topology

If this coord is beyond the max value for its dimension, wrap it around the max value

Provided Methods§

The maximum quantum for this dimension

Convert to the absolute u32 coordinate space, wrapping if needed

Exposes wrapping addition for the u32

Exposes wrapping subtraction for the u32

Implementors§