Skip to main content

OrderedScan

Trait OrderedScan 

Source
pub trait OrderedScan: Sealed + Copy {
    type Key: Key;
    type Row;
    type Iter: Iterator<Item = Self::Row>;
    type KeyIter: Iterator<Item = Self::Key>;

    // Required methods
    fn scan(
        self,
        start: Bound<Self::Key>,
        end: Bound<Self::Key>,
        dir: Dir,
    ) -> Self::Iter;
    fn scan_keys(
        self,
        start: Bound<Self::Key>,
        end: Bound<Self::Key>,
        dir: Dir,
    ) -> Self::KeyIter;
    fn peek_row_key(row: &Self::Row) -> Self::Key;
}
Expand description

Ordered, direction-aware scan seam. Implemented only on TreeScan / MapScan — never on collection types directly — so a non-iterable Map cannot obtain a value of this trait.

Required Associated Types§

Source

type Key: Key

Source

type Row

Source

type Iter: Iterator<Item = Self::Row>

Source

type KeyIter: Iterator<Item = Self::Key>

Required Methods§

Source

fn scan( self, start: Bound<Self::Key>, end: Bound<Self::Key>, dir: Dir, ) -> Self::Iter

Takes self by value (TreeScan/MapScan are Copy) so the returned iterator is not tied to a temporary &Self borrow — required for Scope::iter(self) fluent chains under a generic S: OrderedScan.

Source

fn scan_keys( self, start: Bound<Self::Key>, end: Bound<Self::Key>, dir: Dir, ) -> Self::KeyIter

Source

fn peek_row_key(row: &Self::Row) -> Self::Key

Key of row without consuming it — used by pagination before handing the row to a closure.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, K: Key + Send + Sync + Hash + Eq, H: WriteHook<K>> OrderedScan for MapScan<&'a VarMap<K, H>>

Source§

type Key = K

Source§

type Row = (K, ByteView)

Source§

type Iter = VarMapRowIter<'a, K, H>

Source§

type KeyIter = VarMapKeyIter<'a, K, H>

Source§

impl<'a, K: Key + Send + Sync + Hash + Eq, T: Send + Sync, C: Codec<T> + Clone + Sync, H: TypedWriteHook<K, T>> OrderedScan for MapScan<&'a VarTypedMap<K, T, C, H>>

Source§

type Key = K

Source§

type Row = (K, T)

Source§

type Iter = VarTypedMapRowIter<'a, K, T, C, H>

Source§

type KeyIter = VarTypedMapKeyIter<'a, K, T, C, H>

Source§

impl<'a, K: Key + Send + Sync + Hash + Eq, T: Send + Sync, C: Codec<T> + Sync, H: TypedWriteHook<K, T>> OrderedScan for MapScan<&'a TypedMap<K, T, C, H>>

Source§

type Key = K

Source§

type Row = (K, TypedRef<'a, T>)

Source§

type Iter = MapRowIter<'a, K, T, C, H>

Source§

type KeyIter = MapKeyIter<'a, K, T, C, H>

Source§

impl<'a, K: Key + Send + Sync + Hash + Eq, const V: usize, H: WriteHook<K>, D: Durability> OrderedScan for MapScan<&'a ConstMap<K, V, H, D>>

Source§

type Key = K

Source§

type Row = (K, [u8; V])

Source§

type Iter = ConstMapRowIter<'a, K, V, H, D>

Source§

type KeyIter = ConstMapKeyIter<'a, K, V, H, D>

Source§

impl<'a, K: Key + Send + Sync + Hash + Eq, const V: usize, T: Copy + IntoBytes + FromBytes + Immutable, H: TypedWriteHook<K, T>, D: Durability> OrderedScan for MapScan<&'a ZeroMap<K, V, T, H, D>>

Source§

type Key = K

Source§

type Row = (K, T)

Source§

type Iter = ZeroMapRowIter<'a, K, V, T, H, D>

Source§

type KeyIter = ZeroMapKeyIter<'a, K, V, T, H, D>

Source§

impl<'a, K: Key, H: WriteHook<K>> OrderedScan for TreeScan<&'a VarTree<K, H>>

Source§

type Key = K

Source§

type Row = (K, ByteView)

Source§

type Iter = VarTreeRowIter<'a, K, H>

Source§

type KeyIter = VarTreeKeyIter<'a, K, H>

Source§

impl<'a, K: Key, T: Send + Sync, C: Codec<T> + Clone, H: TypedWriteHook<K, T>> OrderedScan for TreeScan<&'a VarTypedTree<K, T, C, H>>

Source§

type Key = K

Source§

type Row = (K, T)

Source§

type Iter = VarTypedTreeRowIter<'a, K, T, C, H>

Source§

type KeyIter = VarTypedTreeKeyIter<'a, K, T, C, H>

Source§

impl<'a, K: Key, T: Send + Sync, C: Codec<T> + Sync, H: TypedWriteHook<K, T>> OrderedScan for TreeScan<&'a TypedTree<K, T, C, H>>

Source§

type Key = K

Source§

type Row = (K, TypedRef<'a, T>)

Source§

type Iter = TreeRowIter<'a, K, T>

Source§

type KeyIter = TreeKeyIter<'a, K, T>

Source§

impl<'a, K: Key, const V: usize, H: WriteHook<K>, D: Durability> OrderedScan for TreeScan<&'a ConstTree<K, V, H, D>>

Source§

type Key = K

Source§

type Row = (K, [u8; V])

Source§

type Iter = ConstTreeRowIter<'a, K, V, <D as Durability>::Loc>

Source§

type KeyIter = ConstTreeKeyIter<'a, K, V, <D as Durability>::Loc>

Source§

impl<'a, K: Key, const V: usize, T: Copy + IntoBytes + FromBytes + Immutable, H: TypedWriteHook<K, T>, D: Durability> OrderedScan for TreeScan<&'a ZeroTree<K, V, T, H, D>>

Source§

type Key = K

Source§

type Row = (K, T)

Source§

type Iter = ZeroTreeRowIter<'a, K, V, T, <D as Durability>::Loc>

Source§

type KeyIter = ZeroTreeKeyIter<'a, K, V, <D as Durability>::Loc>