[][src]Struct extindex::reader::Reader

pub struct Reader<K, V> where
    K: Ord + Encodable<K>,
    V: Encodable<V>, 
{ /* fields omitted */ }

Index reader

Methods

impl<K, V> Reader<K, V> where
    K: Ord + Encodable<K>,
    V: Encodable<V>, 
[src]

pub fn open<P: AsRef<Path>>(path: P) -> Result<Reader<K, V>, ReaderError>[src]

Open an index file built using the Builder at the given path.

pub fn find(&self, needle: &K) -> Result<Option<Entry<K, V>>, ReaderError>[src]

Finds any entry matching the given needle. This means that there is no guarantee on which entry is returned first if the key is present multiple times.

pub fn find_first(&self, needle: &K) -> Result<Option<Entry<K, V>>, ReaderError>[src]

Finds the first entry matching the given needle. This is guarantee to return the first entry that the iterator had given at build time.

Warning: Make sure that you sort by key + value and use stable sorting if you care in which order values are returned.

pub fn iter<'a>(&'a self) -> impl Iterator<Item = Entry<K, V>> + 'a[src]

Returns an iterator that iterates from the beginning of the index to the index of the index.

pub fn iter_from<'a>(
    &'a self,
    needle: &K
) -> Result<impl Iterator<Item = Entry<K, V>> + 'a, ReaderError>
[src]

Returns an iterator that iterates from the given needle.

Warning: Make sure that you sort by key + value and use stable sorting if you care in which order values are returned.

Auto Trait Implementations

impl<K, V> Send for Reader<K, V> where
    K: Send,
    V: Send

impl<K, V> Sync for Reader<K, V> where
    K: Sync,
    V: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.