Trait holochain::prelude::dependencies::kitsune_p2p_types::dht::arq::ArqStart
pub trait ArqStart: Sized + Copy + Debug {
// Required methods
fn to_loc(&self, topo: &Topology, power: u8) -> DhtLocation;
fn to_offset(&self, topo: &Topology, power: u8) -> SpaceOffset;
fn requantize_up(&self, factor: u32) -> Option<Self>;
fn requantize_down(&self, factor: u32) -> Self;
}
Expand description
Represents the start point or “left edge” of an Arq.
This helps us generalize over the two use cases of Arq:
- An Arq which is defined at a definite absolute DhtLocation corresponding to an Agent’s location, and which can be requantized, resized, etc.
- An Arq which has no absolute location defined, and which simply represents a (quantized) range.
Required Methods§
fn to_loc(&self, topo: &Topology, power: u8) -> DhtLocation
fn to_loc(&self, topo: &Topology, power: u8) -> DhtLocation
Get the DhtLocation representation
fn to_offset(&self, topo: &Topology, power: u8) -> SpaceOffset
fn to_offset(&self, topo: &Topology, power: u8) -> SpaceOffset
Get the exponential SpaceOffset representation
fn requantize_up(&self, factor: u32) -> Option<Self>
fn requantize_up(&self, factor: u32) -> Option<Self>
Requantize to a higher power, using the precalculated multiplicative factor.
fn requantize_down(&self, factor: u32) -> Self
fn requantize_down(&self, factor: u32) -> Self
Requantize to a lower power, using the precalculated multiplicative factor.