Enum kitsune_p2p_dht_arc::DhtArcSet
source · pub enum DhtArcSet {
Full,
Partial(IntervalSet<DhtLocation>),
}
Variants§
Full
Full coverage.
This needs a special representation because the underlying IntervalSet
implementation excludes u32::MAX
from its set of valid bounds
Partial(IntervalSet<DhtLocation>)
Any coverage other than full, including empty
Implementations§
source§impl DhtArcSet
impl DhtArcSet
pub fn new_empty() -> Self
pub fn new_full() -> Self
pub fn normalized(self) -> Self
pub fn from_bounds(start: DhtLocation, end: DhtLocation) -> Self
pub fn from_interval<A: Borrow<DhtArcRange>>(arc: A) -> Self
pub fn intervals(&self) -> Vec<DhtArcRange> ⓘ
pub fn is_empty(&self) -> bool
pub fn contains(&self, t: DhtLocation) -> bool
sourcepub fn overlap(&self, other: &Self) -> bool
pub fn overlap(&self, other: &Self) -> bool
Cheap check if the two sets have a non-null intersection
pub fn union(&self, other: &Self) -> Self
pub fn intersection(&self, other: &Self) -> Self
pub fn size(&self) -> u32
Trait Implementations§
source§impl From<&[DhtArcRange<DhtLocation>]> for DhtArcSet
impl From<&[DhtArcRange<DhtLocation>]> for DhtArcSet
source§fn from(arcs: &[DhtArcRange]) -> Self
fn from(arcs: &[DhtArcRange]) -> Self
Converts to this type from the input type.
source§impl From<&DhtArcRange<DhtLocation>> for DhtArcSet
impl From<&DhtArcRange<DhtLocation>> for DhtArcSet
source§fn from(arc: &DhtArcRange) -> Self
fn from(arc: &DhtArcRange) -> Self
Converts to this type from the input type.
source§impl From<DhtArcRange<DhtLocation>> for DhtArcSet
impl From<DhtArcRange<DhtLocation>> for DhtArcSet
source§fn from(arc: DhtArcRange) -> Self
fn from(arc: DhtArcRange) -> Self
Converts to this type from the input type.
source§impl From<Vec<(DhtLocation, DhtLocation), Global>> for DhtArcSet
impl From<Vec<(DhtLocation, DhtLocation), Global>> for DhtArcSet
source§fn from(pairs: Vec<(DhtLocation, DhtLocation)>) -> Self
fn from(pairs: Vec<(DhtLocation, DhtLocation)>) -> Self
Converts to this type from the input type.
source§impl From<Vec<DhtArcRange<DhtLocation>, Global>> for DhtArcSet
impl From<Vec<DhtArcRange<DhtLocation>, Global>> for DhtArcSet
source§fn from(arcs: Vec<DhtArcRange>) -> Self
fn from(arcs: Vec<DhtArcRange>) -> Self
Converts to this type from the input type.