Skip to main content

SortedScanQuery

Struct SortedScanQuery 

Source
pub struct SortedScanQuery<'a, K> { /* private fields */ }
Expand description

Materialized, sorted view of findings selected by a ScanQuery.

This type owns only the vector of borrowed (source, finding) pairs. Source keys and findings remain owned by the originating ScanResults.

Implementations§

Source§

impl<'a, K> SortedScanQuery<'a, K>

Source

pub const fn len(&self) -> usize

Returns the number of sorted findings.

Source

pub const fn count(&self) -> usize

Returns the number of sorted findings.

Source

pub const fn has_matches(&self) -> bool

Returns true when the sorted query contains at least one finding.

Source

pub const fn is_empty(&self) -> bool

Returns true when the sorted query contains no findings.

Source

pub fn iter( &self, ) -> impl DoubleEndedIterator<Item = (&'a K, &'a Finding)> + ExactSizeIterator + '_

Iterates over sorted (source, finding) pairs.

Source

pub fn first(&self) -> Option<(&'a K, &'a Finding)>

Returns the first sorted finding, if any.

Source

pub fn last(&self) -> Option<(&'a K, &'a Finding)>

Returns the last sorted finding, if any.

Source

pub fn as_slice(&self) -> &[(&'a K, &'a Finding)]

Returns the sorted findings as a borrowed slice.

Source

pub fn to_vec(&self) -> Vec<(&'a K, &'a Finding)>

Returns the sorted borrowed pairs as a new vector.

Only references are copied; source keys and findings are not cloned.

Source

pub fn into_vec(self) -> Vec<(&'a K, &'a Finding)>

Consumes the sorted query and returns its borrowed pairs without copying the vector.

Trait Implementations§

Source§

impl<'a, K: Clone> Clone for SortedScanQuery<'a, K>

Source§

fn clone(&self) -> SortedScanQuery<'a, K>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, K: Debug> Debug for SortedScanQuery<'a, K>

Source§

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

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

impl<'a, K> IntoIterator for SortedScanQuery<'a, K>

Source§

type Item = (&'a K, &'a Finding)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<<SortedScanQuery<'a, K> as IntoIterator>::Item>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'query, 'a, K> IntoIterator for &'query SortedScanQuery<'a, K>

Source§

type Item = (&'a K, &'a Finding)

The type of the elements being iterated over.
Source§

type IntoIter = Copied<Iter<'query, (&'a K, &'a Finding)>>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'a, K> Freeze for SortedScanQuery<'a, K>
where Vec<(&'a K, &'a Finding)>: Freeze,

§

impl<'a, K> RefUnwindSafe for SortedScanQuery<'a, K>
where Vec<(&'a K, &'a Finding)>: RefUnwindSafe,

§

impl<'a, K> Send for SortedScanQuery<'a, K>
where Vec<(&'a K, &'a Finding)>: Send,

§

impl<'a, K> Sync for SortedScanQuery<'a, K>
where Vec<(&'a K, &'a Finding)>: Sync,

§

impl<'a, K> Unpin for SortedScanQuery<'a, K>
where Vec<(&'a K, &'a Finding)>: Unpin,

§

impl<'a, K> UnsafeUnpin for SortedScanQuery<'a, K>
where Vec<(&'a K, &'a Finding)>: UnsafeUnpin,

§

impl<'a, K> UnwindSafe for SortedScanQuery<'a, K>
where Vec<(&'a K, &'a Finding)>: 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.