Trait Keys

Source
pub trait Keys {
    // Required methods
    fn next(&mut self, internal: &Internal) -> Result<usize, KeyError>;
    fn finalize(&mut self) -> Result<(), KeyError>;

    // Provided methods
    fn chain<U: IntoKeys>(self, other: U) -> Chain<Self, U::IntoKeys>
       where Self: Sized { ... }
    fn track(self) -> Track<Self>
       where Self: Sized { ... }
    fn short(self) -> Short<Self>
       where Self: Sized { ... }
}
Expand description

Capability to yield and look up Keys

Required Methods§

Source

fn next(&mut self, internal: &Internal) -> Result<usize, KeyError>

Look up the next key in a Internal and convert to usize index.

This must be fused (like core::iter::FusedIterator).

Source

fn finalize(&mut self) -> Result<(), KeyError>

Finalize the keys, ensure there are no more.

This must be fused.

Provided Methods§

Source

fn chain<U: IntoKeys>(self, other: U) -> Chain<Self, U::IntoKeys>
where Self: Sized,

Chain another Keys to this one.

Source

fn track(self) -> Track<Self>
where Self: Sized,

Track depth

Source

fn short(self) -> Short<Self>
where Self: Sized,

Track whether a leaf node is reached

Implementations on Foreign Types§

Source§

impl<T: Keys + ?Sized> Keys for &mut T

Source§

fn next(&mut self, internal: &Internal) -> Result<usize, KeyError>

Source§

fn finalize(&mut self) -> Result<(), KeyError>

Implementors§

Source§

impl Keys for Packed

Source§

impl<K: Keys> Keys for Short<K>

Source§

impl<K: Keys> Keys for Track<K>

Source§

impl<T> Keys for KeysIter<T>
where T: Iterator, T::Item: Key,

Source§

impl<T: Keys, U: Keys> Keys for Chain<T, U>