pub struct Partition<T: Copy + Ord> { /* private fields */ }
Implementations§
Source§impl<T: Copy + Ord> Partition<T>
impl<T: Copy + Ord> Partition<T>
pub fn new() -> Partition<T>
Sourcepub fn is_rep(&self, elt: &T) -> bool
pub fn is_rep(&self, elt: &T) -> bool
Is the given element the representative of its component?
Sourcepub fn merge(&mut self, elt1: T, elt2: T) -> bool
pub fn merge(&mut self, elt1: T, elt2: T) -> bool
Returns true if there was a merge to be done (i.e. they didn’t already belong to the same part).
pub fn representative_mut(&mut self, elt: T) -> T
pub fn representative(&self, elt: T) -> T
pub fn same_part_mut(&mut self, elt1: T, elt2: T) -> bool
pub fn same_part(&self, elt1: T, elt2: T) -> bool
pub fn contains(&self, elt: T) -> bool
pub fn remove_part(&mut self, elt: T)
pub fn iter_part<'a>(&'a self, elt: T) -> impl Iterator<Item = T> + 'a
pub fn iter_parts<'a>( &'a self, ) -> impl Iterator<Item = impl Iterator<Item = T> + 'a> + 'a
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Partition<T>
impl<'de, T> Deserialize<'de> for Partition<T>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Copy + Ord, PI: IntoIterator<Item = T>> FromIterator<PI> for Partition<T>
impl<T: Copy + Ord, PI: IntoIterator<Item = T>> FromIterator<PI> for Partition<T>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = PI>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = PI>,
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl<T> Freeze for Partition<T>
impl<T> RefUnwindSafe for Partition<T>where
T: RefUnwindSafe,
impl<T> Send for Partition<T>where
T: Send,
impl<T> Sync for Partition<T>where
T: Sync,
impl<T> Unpin for Partition<T>
impl<T> UnwindSafe for Partition<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