[−][src]Struct jp_partition::Partition
Methods
impl<T: Copy + Ord> Partition<T>
[src]
pub fn new() -> Partition<T>
[src]
pub fn insert(&mut self, elt: T)
[src]
Panics if the new element already exists.
pub fn is_rep(&self, elt: &T) -> bool
[src]
Is the given element the representative of its component?
pub fn merge(&mut self, elt1: T, elt2: T) -> bool
[src]
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
[src]
pub fn representative(&self, elt: T) -> T
[src]
pub fn same_part_mut(&mut self, elt1: T, elt2: T) -> bool
[src]
pub fn same_part(&self, elt1: T, elt2: T) -> bool
[src]
pub fn contains(&self, elt: T) -> bool
[src]
pub fn remove_part(&mut self, elt: T)
[src]
pub fn iter_part<'a>(
&'a self,
elt: T
) -> impl Iterator<Item = T> + 'a
[src]
&'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
[src]
&'a self
) -> impl Iterator<Item = impl Iterator<Item = T> + 'a> + 'a
Trait Implementations
impl<T: Copy + Ord> Default for Partition<T>
[src]
impl<T: Clone + Copy + Ord> Clone for Partition<T>
[src]
fn clone(&self) -> Partition<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Debug + Copy + Ord> Debug for Partition<T>
[src]
impl<T: Copy + Ord, PI: IntoIterator<Item = T>> FromIterator<PI> for Partition<T>
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = PI>,
[src]
I: IntoIterator<Item = PI>,
impl<'de, T: Copy + Ord> Deserialize<'de> for Partition<T> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T: Copy + Ord> Serialize for Partition<T> where
T: Serialize,
[src]
T: Serialize,
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,