QueryableExt

Trait QueryableExt 

Source
pub trait QueryableExt<T> {
    // Required method
    fn lazy_query(&self) -> LazyQuery<'_, T, Box<dyn Iterator<Item = &T> + '_>>;
}
Expand description

Extension trait for Queryable types that provides query building capabilities.

This trait extends any type implementing Queryable<T> with methods to create LazyQuery instances directly from the container’s iterator.

§Example

use rust_queries_builder::QueryableExt;
 
let map: HashMap<String, Product> = ...;
let results: Vec<_> = map.lazy_query()
    .where_(Product::price_r(), |&p| p > 100.0)
    .collect();

Required Methods§

Source

fn lazy_query(&self) -> LazyQuery<'_, T, Box<dyn Iterator<Item = &T> + '_>>

Create a lazy query from this Queryable container

This returns a LazyQuery that can be used with all lazy query operations. The operations are executed lazily when a terminal operation is called.

Implementors§

Source§

impl<T: 'static, Q> QueryableExt<T> for Q
where Q: Queryable<T>,