pub struct IntegerPartitions<T: Copy + Integer + ToPrimitive> { /* private fields */ }
Expand description
A collection of disjoint integer intervals
Implementations§
Source§impl<T: Copy + Integer + ToPrimitive> IntegerPartitions<T>
impl<T: Copy + Integer + ToPrimitive> IntegerPartitions<T>
pub fn new(partitions: Vec<Partition<T>>) -> IntegerPartitions<T>
pub fn num_partitions(&self) -> usize
Sourcepub fn iter(&self) -> IntegerPartitionIter<T> ⓘ
pub fn iter(&self) -> IntegerPartitionIter<T> ⓘ
Creates an iterator that iterates through the partitions.
Trait Implementations§
Source§impl<T: Clone + Copy + Integer + ToPrimitive> Clone for IntegerPartitions<T>
impl<T: Clone + Copy + Integer + ToPrimitive> Clone for IntegerPartitions<T>
Source§fn clone(&self) -> IntegerPartitions<T>
fn clone(&self) -> IntegerPartitions<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug + Copy + Integer + ToPrimitive> Debug for IntegerPartitions<T>
impl<T: Debug + Copy + Integer + ToPrimitive> Debug for IntegerPartitions<T>
Source§impl<T: Copy + Integer + ToPrimitive> Index<usize> for IntegerPartitions<T>
impl<T: Copy + Integer + ToPrimitive> Index<usize> for IntegerPartitions<T>
Source§impl<T: PartialEq + Copy + Integer + ToPrimitive> PartialEq for IntegerPartitions<T>
impl<T: PartialEq + Copy + Integer + ToPrimitive> PartialEq for IntegerPartitions<T>
impl<T: Eq + Copy + Integer + ToPrimitive> Eq for IntegerPartitions<T>
impl<T: Copy + Integer + ToPrimitive> StructuralPartialEq for IntegerPartitions<T>
Auto Trait Implementations§
impl<T> Freeze for IntegerPartitions<T>
impl<T> RefUnwindSafe for IntegerPartitions<T>where
T: RefUnwindSafe,
impl<T> Send for IntegerPartitions<T>where
T: Send,
impl<T> Sync for IntegerPartitions<T>where
T: Sync,
impl<T> Unpin for IntegerPartitions<T>where
T: Unpin,
impl<T> UnwindSafe for IntegerPartitions<T>where
T: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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