Trait holochain::prelude::kitsune_p2p::dependencies::kitsune_p2p_types::dht::prelude::Quantum
pub trait Quantum: Copy + Clone + From<u32> + PartialEq<Self> + Eq + PartialOrd<Self> + Ord + Debug {
type Absolute;
// Required methods
fn inner(&self) -> u32;
fn dimension(topo: &Topology) -> &Dimension;
fn normalized(self, topo: &Topology) -> Self;
// Provided methods
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§
type Absolute
type Absolute
The absolute coordinate which this quantum corresponds to (time or space)
Required Methods§
fn dimension(topo: &Topology) -> &Dimension
fn dimension(topo: &Topology) -> &Dimension
Return the proper dimension (time or space) from the topology
fn normalized(self, topo: &Topology) -> Self
fn normalized(self, topo: &Topology) -> Self
If this coord is beyond the max value for its dimension, wrap it around the max value
Provided Methods§
fn exp_wrapping(&self, topo: &Topology, pow: u8) -> u32
fn exp_wrapping(&self, topo: &Topology, pow: u8) -> u32
Convert to the absolute u32 coordinate space, wrapping if needed
fn wrapping_add(self, other: u32) -> Self
fn wrapping_add(self, other: u32) -> Self
Exposes wrapping addition for the u32
fn wrapping_sub(self, other: u32) -> Self
fn wrapping_sub(self, other: u32) -> Self
Exposes wrapping subtraction for the u32