Struct KeyStrategy

Source
pub struct KeyStrategy<F, T, K> {
    pub key: F,
    /* private fields */
}
Expand description

A key-based unordered sort on a type

Fields§

§key: F

The underlying key extraction function

Trait Implementations§

Source§

impl<F: Clone, T: Clone, K: Clone> Clone for KeyStrategy<F, T, K>

Source§

fn clone(&self) -> KeyStrategy<F, T, K>

Returns a copy 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<F: Debug, T: Debug, K: Debug> Debug for KeyStrategy<F, T, K>

Source§

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

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

impl<F, T, K> KeyBytes<T> for KeyStrategy<F, T, K>
where K: RadixSortKey, F: Fn(&T) -> K,

Source§

const HAS_CONST_KEY_LEN: bool = K::HAS_CONST_KEY_LEN

Get whether the key length for this type is always constant
Source§

const MAX_KEY_LEN: Option<usize> = K::MAX_KEY_LEN

Get the maximum key length for this type
Source§

fn has_const_key_len(&self) -> bool

Whether this key length is constant
Source§

fn max_key_len(&self) -> Option<usize>

The maximum key length
Source§

fn key_len(&self, key: &T) -> usize

The length of a given key
Source§

fn key_byte(&self, key: &T, byte: usize) -> u8

Get the nth byte of a given key. byte must be less than self.len(key)
Source§

impl<F, T, K> TrySorter<T> for KeyStrategy<F, T, K>
where F: FnMut(&T) -> K, K: RadixSortKey,

Source§

fn try_sort( &mut self, arr: &mut [T], depth: isize, _iteration: usize, force: bool, ) -> bool

Try to sort arr, assuming we’re at a given depth and iteration. Return whether the array was sorted. If force is true, then should always sort.
Source§

impl<F: Copy, T: Copy, K: Copy> Copy for KeyStrategy<F, T, K>

Auto Trait Implementations§

§

impl<F, T, K> Freeze for KeyStrategy<F, T, K>
where F: Freeze,

§

impl<F, T, K> RefUnwindSafe for KeyStrategy<F, T, K>

§

impl<F, T, K> Send for KeyStrategy<F, T, K>
where F: Send, T: Send, K: Send,

§

impl<F, T, K> Sync for KeyStrategy<F, T, K>
where F: Sync, T: Sync, K: Sync,

§

impl<F, T, K> Unpin for KeyStrategy<F, T, K>
where F: Unpin, T: Unpin, K: Unpin,

§

impl<F, T, K> UnwindSafe for KeyStrategy<F, T, K>
where F: UnwindSafe, T: UnwindSafe, K: 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.
Source§

impl<T, K> RadixSortStrategy<K> for T
where T: KeyBytes<K> + TrySorter<K>,