pub struct KeyedUnionFind<X>{ /* private fields */ }Implementations§
Source§impl<X> KeyedUnionFind<X>
impl<X> KeyedUnionFind<X>
pub fn new() -> Self
pub fn insert(&mut self, x: X) -> usize
pub fn size(&self) -> usize
pub fn contains(&self, x: &X) -> bool
pub fn root(&self, x: &X) -> &X
pub fn is_same(&self, x: &X, y: &X) -> bool
pub fn union(&mut self, x: &X, y: &X)
pub fn group(&self) -> Vec<Vec<&X>>
pub fn into_group(self) -> Vec<Vec<X>>
Trait Implementations§
Source§impl<X> FromIterator<X> for KeyedUnionFind<X>
impl<X> FromIterator<X> for KeyedUnionFind<X>
Source§fn from_iter<T: IntoIterator<Item = X>>(keys: T) -> Self
fn from_iter<T: IntoIterator<Item = X>>(keys: T) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl<X> Freeze for KeyedUnionFind<X>
impl<X> RefUnwindSafe for KeyedUnionFind<X>where
X: RefUnwindSafe,
impl<X> !Send for KeyedUnionFind<X>
impl<X> !Sync for KeyedUnionFind<X>
impl<X> Unpin for KeyedUnionFind<X>
impl<X> UnwindSafe for KeyedUnionFind<X>where
X: 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> 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