pub struct PartitionInfo {
pub count_or_offset: usize,
pub next_offset: usize,
}Expand description
Partition information for an array
Fields§
§count_or_offset: usizeThe beginning of a partition or the number of elements which should be in a partition depending on the phase of the algorithm.
next_offset: usizeThe end of the partition
Implementations§
Source§impl PartitionInfo
impl PartitionInfo
Sourcepub fn slice_offset<T>(slice: &[T], offset: usize) -> PartitionInfo
pub fn slice_offset<T>(slice: &[T], offset: usize) -> PartitionInfo
Create a partition for a given slice at a given offset
Sourcepub fn slice_mut<'a, T>(&self, slice: &'a mut [T]) -> &'a mut [T]
pub fn slice_mut<'a, T>(&self, slice: &'a mut [T]) -> &'a mut [T]
Get a mutable slice of a partition from an array
Sourcepub fn end<'a, T>(&self, slice: &'a [T]) -> &'a [T]
pub fn end<'a, T>(&self, slice: &'a [T]) -> &'a [T]
Get a slice up to the end of a partition from an array
Sourcepub fn end_mut<'a, T>(&self, slice: &'a mut [T]) -> &'a mut [T]
pub fn end_mut<'a, T>(&self, slice: &'a mut [T]) -> &'a mut [T]
Get a mutable slice up to the end of a partition from an array
Sourcepub fn filter<T, P>(&mut self, slice: &mut [T], p: P) -> usize
pub fn filter<T, P>(&mut self, slice: &mut [T], p: P) -> usize
Filter this partition, removing all elements satisfying predicate p and moving them
to the old beginning of the partition. Return the number of elements removed.
Sourcepub fn filter_mut<T, P>(&mut self, slice: &mut [T], p: P) -> usize
pub fn filter_mut<T, P>(&mut self, slice: &mut [T], p: P) -> usize
Filter this partition, removing all elements satisfying predicate p and moving them
to the old beginning of the partition. Return the number of elements removed.
Sourcepub fn stack(&mut self, other: PartitionInfo)
pub fn stack(&mut self, other: PartitionInfo)
Set this partition’s beginning to the other’s end
Trait Implementations§
Source§impl Clone for PartitionInfo
impl Clone for PartitionInfo
Source§fn clone(&self) -> PartitionInfo
fn clone(&self) -> PartitionInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more