pub struct SortIterator<I: RowIterator> { /* private fields */ }Expand description
Iterator that sorts rows according to ORDER BY expressions.
Note: Sorting requires materializing all input rows into memory. This iterator collects all rows from its input, sorts them, and then yields them one at a time.
Implementations§
Source§impl<I: RowIterator> SortIterator<I>
impl<I: RowIterator> SortIterator<I>
Sourcepub fn new(input: I, order_by: &[SortExpr]) -> Result<Self>
pub fn new(input: I, order_by: &[SortExpr]) -> Result<Self>
Creates a new sort iterator.
This constructor immediately materializes all input rows and sorts them.
§Errors
Returns an error if reading from input fails or if sort key evaluation fails.
Sourcepub fn new_with_policy(
input: I,
order_by: &[SortExpr],
policy: Option<MemoryPolicy>,
) -> Result<Self>
pub fn new_with_policy( input: I, order_by: &[SortExpr], policy: Option<MemoryPolicy>, ) -> Result<Self>
Creates a new sort iterator with an optional memory policy.
Trait Implementations§
Source§impl<I: RowIterator> RowIterator for SortIterator<I>
impl<I: RowIterator> RowIterator for SortIterator<I>
Auto Trait Implementations§
impl<I> !RefUnwindSafe for SortIterator<I>
impl<I> !Send for SortIterator<I>
impl<I> !Sync for SortIterator<I>
impl<I> !UnwindSafe for SortIterator<I>
impl<I> Freeze for SortIterator<I>
impl<I> Unpin for SortIterator<I>where
I: Unpin,
impl<I> UnsafeUnpin for SortIterator<I>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more