Struct HashSubsets

Source
pub struct HashSubsets<T>
where <T as TryInto<usize>>::Error: Debug, <T as TryFrom<usize>>::Error: Debug, T: Clone + TryInto<usize> + TryFrom<usize> + Hash + Eq,
{ /* private fields */ }
Expand description

Maintains subsets of a set partition using HashSets

Pass this as the Subsets implementation to the SetPartition structs.

Implementations§

Source§

impl<T> HashSubsets<T>
where <T as TryInto<usize>>::Error: Debug, <T as TryFrom<usize>>::Error: Debug, T: Clone + TryInto<usize> + TryFrom<usize> + Hash + Eq,

Source

pub fn subsets(&self) -> &[HashSet<T>]

Return the non-empty subsets part of the set partition

Trait Implementations§

Source§

impl<T> Clone for HashSubsets<T>
where <T as TryInto<usize>>::Error: Debug, <T as TryFrom<usize>>::Error: Debug, T: Clone + TryInto<usize> + TryFrom<usize> + Hash + Eq + Clone,

Source§

fn clone(&self) -> HashSubsets<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for HashSubsets<T>
where <T as TryInto<usize>>::Error: Debug, <T as TryFrom<usize>>::Error: Debug, T: Clone + TryInto<usize> + TryFrom<usize> + Hash + Eq + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Default for HashSubsets<T>
where <T as TryInto<usize>>::Error: Debug, <T as TryFrom<usize>>::Error: Debug, T: Clone + TryInto<usize> + TryFrom<usize> + Hash + Eq,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T> Subsets<T> for HashSubsets<T>
where <T as TryInto<usize>>::Error: Debug, <T as TryFrom<usize>>::Error: Debug, T: Clone + TryInto<usize> + TryFrom<usize> + Hash + Eq,

Source§

fn set_limit(&mut self, m: &T)

Set the number of non-empty sets to m converted to usize
Source§

fn inc_limit(&mut self)

Increment the number of non-empty sets
Source§

fn clear(&mut self)

Clear all sets, reset the number of non-empty sets to 0
Source§

fn done(&mut self, n: usize)

Truncate the number of sets to at most n
Source§

fn reset(&mut self, n: usize)

Reset to the trivial partition of size n
Source§

fn add(&mut self, idx: usize, v: &T)

Notify addition of idx to the set identified by v Read more
Source§

fn remove(&mut self, idx: usize, v: &T)

Notify removal of idx from the set identified by v Read more

Auto Trait Implementations§

§

impl<T> Freeze for HashSubsets<T>

§

impl<T> RefUnwindSafe for HashSubsets<T>
where T: RefUnwindSafe,

§

impl<T> Send for HashSubsets<T>
where T: Send,

§

impl<T> Sync for HashSubsets<T>
where T: Sync,

§

impl<T> Unpin for HashSubsets<T>
where T: Unpin,

§

impl<T> UnwindSafe for HashSubsets<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.