pub struct Collator<T> { /* private fields */ }
Expand description
A generic collator for any type T: Ord
.
Trait Implementations
sourceimpl<T: Ord> Collate for Collator<T>
impl<T: Ord> Collate for Collator<T>
type Value = T
sourcefn compare(&self, left: &Self::Value, right: &Self::Value) -> Ordering
fn compare(&self, left: &Self::Value, right: &Self::Value) -> Ordering
Define the relative ordering of Self::Value
.
sourcefn bisect<V: AsRef<[Self::Value]>, B: Borrow<[Self::Value]>>(
&self,
slice: &[V],
range: &Range<Self::Value, B>
) -> (usize, usize)
fn bisect<V: AsRef<[Self::Value]>, B: Borrow<[Self::Value]>>(
&self,
slice: &[V],
range: &Range<Self::Value, B>
) -> (usize, usize)
Given a collection of slices, return the start and end indices which match the given range.
sourcefn bisect_left<V: AsRef<[Self::Value]>>(
&self,
slice: &[V],
key: &[Self::Value]
) -> usize
fn bisect_left<V: AsRef<[Self::Value]>>(
&self,
slice: &[V],
key: &[Self::Value]
) -> usize
Given a collection of slices, return the leftmost insert point matching the given key.
sourcefn bisect_right<V: AsRef<[Self::Value]>>(
&self,
slice: &[V],
key: &[Self::Value]
) -> usize
fn bisect_right<V: AsRef<[Self::Value]>>(
&self,
slice: &[V],
key: &[Self::Value]
) -> usize
Given a collection of slices, return the rightmost insert point matching the given key.
sourcefn compare_range<B: Borrow<[Self::Value]>>(
&self,
key: &[Self::Value],
range: &Range<Self::Value, B>
) -> Ordering
fn compare_range<B: Borrow<[Self::Value]>>(
&self,
key: &[Self::Value],
range: &Range<Self::Value, B>
) -> Ordering
Returns the ordering of the given key relative to the given range.
Auto Trait Implementations
impl<T> RefUnwindSafe for Collator<T> where
T: RefUnwindSafe,
impl<T> Send for Collator<T> where
T: Send,
impl<T> Sync for Collator<T> where
T: Sync,
impl<T> Unpin for Collator<T> where
T: Unpin,
impl<T> UnwindSafe for Collator<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more