aph_disjoint_set 0.1.1

Disjoint set implementation with optimized memory usage and ability to detach elements.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[derive(Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, Debug)]
#[repr(transparent)]
pub struct Root(pub(crate) usize);

impl Root {
    #[inline]
    #[must_use]
    pub fn into_inner(self) -> usize {
        self.0
    }
}

#[derive(Clone, Copy, Eq, PartialEq, Debug)]
pub enum UnionResult {
    AlreadyJoined,
    Success,
}