pub struct NodeSet<N: Node> {
nodes: Vec<N>,
is_sorted: bool,
}Fields§
§nodes: Vec<N>§is_sorted: boolImplementations§
Source§impl<N: Node> NodeSet<N>
impl<N: Node> NodeSet<N>
pub(crate) fn len(&self) -> usize
fn is_empty(&self) -> bool
pub(crate) fn push(&mut self, node: N)
pub(crate) fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = N>,
Sourcepub(crate) fn is_sorted(&self) -> bool
pub(crate) fn is_sorted(&self) -> bool
Whether this set is known to be sorted in tree order.
This method is pessimistic and will never look at the elements in the set.
As such, it may return false even if the set happens to be sorted.
Sourcepub(crate) fn assume_sorted(&mut self)
pub(crate) fn assume_sorted(&mut self)
Assume that this set is sorted, without actually sorting it.
pub(crate) fn sort(&mut self)
pub(crate) fn iter(&self) -> impl Iterator<Item = &N>
Sourcepub(crate) fn first(&self) -> Option<N>
pub(crate) fn first(&self) -> Option<N>
Return the first node in tree order that appears within this set.
This method will not sort the set itself.
pub(crate) fn deduplicate(&mut self)
Sourcepub(crate) fn retain<F>(&mut self, f: F)
pub(crate) fn retain<F>(&mut self, f: F)
Retains only the elements specified by the predicate.
In other words, remove all elements e for which f(&e) returns false.
This method operates in place, visiting each element exactly once in the
original order, and preserves the order of the retained elements.
pub(crate) fn reverse(&mut self)
Trait Implementations§
Source§impl<N: Node> FromIterator<N> for NodeSet<N>
impl<N: Node> FromIterator<N> for NodeSet<N>
Source§fn from_iter<T: IntoIterator<Item = N>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = N>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl<N: Node> IntoIterator for NodeSet<N>
impl<N: Node> IntoIterator for NodeSet<N>
Auto Trait Implementations§
impl<N> Freeze for NodeSet<N>
impl<N> RefUnwindSafe for NodeSet<N>where
N: RefUnwindSafe,
impl<N> Send for NodeSet<N>where
N: Send,
impl<N> Sync for NodeSet<N>where
N: Sync,
impl<N> Unpin for NodeSet<N>where
N: Unpin,
impl<N> UnwindSafe for NodeSet<N>where
N: UnwindSafe,
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> 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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert