Trait holochain::prelude::kitsune_p2p::dependencies::kitsune_p2p_types::dht::prelude::Quantum
source · pub trait Quantum: Copy + Clone + From<u32> + PartialEq + Eq + PartialOrd + 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§
Required Methods§
sourcefn dimension(topo: &Topology) -> &Dimension
fn dimension(topo: &Topology) -> &Dimension
Return the proper dimension (time or space) from the topology
sourcefn 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§
sourcefn 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
sourcefn wrapping_add(self, other: u32) -> Self
fn wrapping_add(self, other: u32) -> Self
Exposes wrapping addition for the u32
sourcefn wrapping_sub(self, other: u32) -> Self
fn wrapping_sub(self, other: u32) -> Self
Exposes wrapping subtraction for the u32
Object Safety§
This trait is not object safe.