[][src]Struct mokuroku::QueryIterator

pub struct QueryIterator<'a> { /* fields omitted */ }

An Iterator returned by the database query functions, yielding instances of QueryResult for each matching index entry.

let db_path = "tmp/assets/database";
let views = vec!["tags".to_owned()];
let mut dbase = Database::open_default(Path::new(db_path), views, Box::new(mapper)).unwrap();
let result = dbase.query_by_key("tags", b"cat");
let iter = result.unwrap();
for result in iter {
    let doc_id = std::str::from_utf8(&result.doc_id).unwrap().to_owned();
    println!("query result key: {:}", doc_id);
}

Trait Implementations

impl<'a> Debug for QueryIterator<'a>[src]

impl<'a> Iterator for QueryIterator<'a>[src]

type Item = QueryResult

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> RefUnwindSafe for QueryIterator<'a>

impl<'a> !Send for QueryIterator<'a>

impl<'a> !Sync for QueryIterator<'a>

impl<'a> Unpin for QueryIterator<'a>

impl<'a> UnwindSafe for QueryIterator<'a>

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.