Enum kitsune_p2p_dht_arc::DhtArcSet
source · [−]pub enum DhtArcSet {
Full,
Partial(IntervalSet<u32>),
}
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<u32>)
Any coverage other than full, including empty
Implementations
sourceimpl DhtArcSet
impl DhtArcSet
pub fn new_empty() -> Self
pub fn new_full() -> Self
pub fn normalized(self) -> Self
pub fn from_bounds(start: u32, end: u32) -> Self
pub fn from_interval<A: Borrow<ArcInterval>>(arc: A) -> Self
pub fn intervals(&self) -> Vec<ArcInterval>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn is_empty(&self) -> bool
pub fn contains(&self, t: u32) -> 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
Trait Implementations
sourceimpl From<&'_ [ArcInterval]> for DhtArcSet
impl From<&'_ [ArcInterval]> for DhtArcSet
sourcefn from(arcs: &[ArcInterval]) -> Self
fn from(arcs: &[ArcInterval]) -> Self
Performs the conversion.
sourceimpl From<&'_ ArcInterval> for DhtArcSet
impl From<&'_ ArcInterval> for DhtArcSet
sourcefn from(arc: &ArcInterval) -> Self
fn from(arc: &ArcInterval) -> Self
Performs the conversion.
sourceimpl From<ArcInterval> for DhtArcSet
impl From<ArcInterval> for DhtArcSet
sourcefn from(arc: ArcInterval) -> Self
fn from(arc: ArcInterval) -> Self
Performs the conversion.
sourceimpl From<Vec<ArcInterval, Global>> for DhtArcSet
impl From<Vec<ArcInterval, Global>> for DhtArcSet
sourcefn from(arcs: Vec<ArcInterval>) -> Self
fn from(arcs: Vec<ArcInterval>) -> Self
Performs the conversion.
impl Eq for DhtArcSet
impl StructuralEq for DhtArcSet
impl StructuralPartialEq for DhtArcSet
Auto Trait Implementations
impl RefUnwindSafe for DhtArcSet
impl Send for DhtArcSet
impl Sync for DhtArcSet
impl Unpin for DhtArcSet
impl UnwindSafe for DhtArcSet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more