pub struct PushExternalSorter<T, F>
where T: Sortable, F: Fn(&T, &T) -> Ordering + Send + Sync + Clone,
{ /* private fields */ }
Expand description

External sorter that uses a “push” pattern instead of consuming an iterator.

It is used internally by the normal pull iterator (ExternalSorter), but can also be used directly to sort items in a push pattern.

Implementations§

source§

impl<T, F> PushExternalSorter<T, F>
where T: Sortable, F: Fn(&T, &T) -> Ordering + Send + Sync + Clone,

source

pub fn push_iter<I>(&mut self, iterator: I) -> Result<(), Error>
where I: IntoIterator<Item = T>,

Pushes all items from an iterator into the sorter.

This can be called multiple times to push more items into the sorter.

source

pub fn push(&mut self, item: T) -> Result<(), Error>

Pushes a single item into the sorter.

source

pub fn done(self) -> Result<SortedIterator<T, F>, Error>

Auto Trait Implementations§

§

impl<T, F> Freeze for PushExternalSorter<T, F>
where F: Freeze,

§

impl<T, F> RefUnwindSafe for PushExternalSorter<T, F>

§

impl<T, F> Send for PushExternalSorter<T, F>

§

impl<T, F> Sync for PushExternalSorter<T, F>
where T: Sync,

§

impl<T, F> Unpin for PushExternalSorter<T, F>
where F: Unpin, T: Unpin,

§

impl<T, F> UnwindSafe for PushExternalSorter<T, F>
where F: UnwindSafe, T: 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> 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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.