pub struct NodeSet<T = IdRangeList> { /* private fields */ }Expand description
An unordered collection of nodes indexed in one or more dimensions.
Two implementations are provided:
NodeSet<IdRangeList>which stores node indices in VecsNodeSet<IdRangeTree>which stores node indices in BTrees
By default IdRangeList are used as they are faster to build for one shot
operations which are the most common, especially when using the CLI.
However, if many updates are performed on a large NodeSet IdRangeTree may
more efficient especially for one-dimensional NodeSets.
Implementations§
Source§impl<T> NodeSet<T>
impl<T> NodeSet<T>
Sourcepub fn iter(&self) -> NodeSetIter<'_, T> ⓘ
pub fn iter(&self) -> NodeSetIter<'_, T> ⓘ
Returns an iterator over all elements of the set
Sourcepub fn union(&self, other: &Self) -> Self
pub fn union(&self, other: &Self) -> Self
Returns a new set containing elements found in self and other
Sourcepub fn difference(&self, other: &Self) -> Self
pub fn difference(&self, other: &Self) -> Self
Returns a new set containing elements found in self but not in other
Sourcepub fn intersection(&self, other: &Self) -> Self
pub fn intersection(&self, other: &Self) -> Self
Returns a new set containing elements that are in both self and other
Sourcepub fn symmetric_difference(&self, other: &Self) -> Self
pub fn symmetric_difference(&self, other: &Self) -> Self
Returns a new set containing the elements found in either self or other but not in both
Trait Implementations§
impl<T: Eq> Eq for NodeSet<T>
impl<T> StructuralPartialEq for NodeSet<T>
Auto Trait Implementations§
impl<T> Freeze for NodeSet<T>
impl<T> RefUnwindSafe for NodeSet<T>where
T: RefUnwindSafe,
impl<T> Send for NodeSet<T>where
T: Send,
impl<T> Sync for NodeSet<T>where
T: Sync,
impl<T> Unpin for NodeSet<T>
impl<T> UnwindSafe for NodeSet<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more