Type Alias kitsune_p2p_dht::arq::ArqBounds
source · pub type ArqBounds = Arq<SpaceOffset>;
Expand description
Alias for Arq with an SpaceOffset start
Aliased Type§
struct ArqBounds {
pub start: SpaceOffset,
pub power: u8,
pub count: SpaceOffset,
}
Fields§
§start: SpaceOffset
The “start” defines the left edge of the arq
power: u8
The level of quantization. Total length is 2^power * count
.
The power must be between 0 and 31, inclusive (power of 32 causes overflow)
count: SpaceOffset
The number of unit lengths. We never expect the count to be less than 4 or so, and not much larger than 32.
Implementations§
source§impl ArqBounds
impl ArqBounds
sourcepub fn equivalent(dim: impl SpaceDim, a: &Self, b: &Self) -> bool
pub fn equivalent(dim: impl SpaceDim, a: &Self, b: &Self) -> bool
The two arqs represent the same interval despite having potentially different terms
sourcepub fn from_interval_rounded(
dim: impl SpaceDim,
power: u8,
interval: DhtArcRange,
) -> (Self, bool)
pub fn from_interval_rounded( dim: impl SpaceDim, power: u8, interval: DhtArcRange, ) -> (Self, bool)
Return the ArqBounds which most closely matches the given DhtArcRange
sourcepub fn from_interval(
dim: impl SpaceDim,
power: u8,
interval: DhtArcRange,
) -> Option<Self>
pub fn from_interval( dim: impl SpaceDim, power: u8, interval: DhtArcRange, ) -> Option<Self>
Return the ArqBounds which is equivalent to the given DhtArcRange
if it exists.
sourcepub fn segments(&self) -> impl Iterator<Item = SpaceSegment> + '_
pub fn segments(&self) -> impl Iterator<Item = SpaceSegment> + '_
Iterate over each segment (chunk) in the Arq
sourcepub fn offset(&self) -> SpaceOffset
pub fn offset(&self) -> SpaceOffset
Get a reference to the arq bounds’s offset.