[−][src]Struct rdx::util::PartitionInfo
Partition information for an array
Fields
count_or_offset: usize
The beginning of a partition or the number of elements which should be in a partition depending on the phase of the algorithm.
next_offset: usize
The end of the partition
Methods
impl PartitionInfo
[src]
pub fn slice_offset<T>(slice: &[T], offset: usize) -> PartitionInfo
[src]
Create a partition for a given slice at a given offset
pub fn slice<'a, T>(&self, slice: &'a [T]) -> &'a [T]
[src]
Get a slice of a partition from an array
pub fn slice_mut<'a, T>(&self, slice: &'a mut [T]) -> &'a mut [T]
[src]
Get a mutable slice of a partition from an array
pub fn end<'a, T>(&self, slice: &'a [T]) -> &'a [T]
[src]
Get a slice up to the end of a partition from an array
pub fn end_mut<'a, T>(&self, slice: &'a mut [T]) -> &'a mut [T]
[src]
Get a mutable slice up to the end of a partition from an array
pub fn filter<T, P>(&mut self, slice: &mut [T], p: P) -> usize where
P: Fn(&T) -> bool,
[src]
P: Fn(&T) -> bool,
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.
pub fn filter_mut<T, P>(&mut self, slice: &mut [T], p: P) -> usize where
P: FnMut(&T) -> bool,
[src]
P: FnMut(&T) -> bool,
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.
pub fn stack(&mut self, other: PartitionInfo)
[src]
Set this partition's beginning to the other's end
pub fn len(&self) -> usize
[src]
Get the length of this partition
pub fn is_valid<T>(&self, arr: &[T]) -> bool
[src]
Check if this partition is valid
Trait Implementations
impl Clone for PartitionInfo
[src]
fn clone(&self) -> PartitionInfo
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PartitionInfo
[src]
impl Debug for PartitionInfo
[src]
impl Default for PartitionInfo
[src]
fn default() -> PartitionInfo
[src]
Auto Trait Implementations
impl RefUnwindSafe for PartitionInfo
impl Send for PartitionInfo
impl Sync for PartitionInfo
impl Unpin for PartitionInfo
impl UnwindSafe for PartitionInfo
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,