Skip to main content

IQuery

Trait IQuery 

Source
pub trait IQuery<T, K> {
    // Required methods
    fn count(&self) -> usize;
    fn items(&self) -> Vec<T>;
    fn keys(&self) -> Vec<K>;
    fn key_values(&self) -> Vec<(K, T)>;
    fn lookup(&self, key: &K) -> Option<T>;
}
Expand description

Read access to a keyed collection (IQuery<TObject, TKey>).

Required Methods§

Source

fn count(&self) -> usize

The number of items (Count).

Source

fn items(&self) -> Vec<T>

The items, in the order of enumeration (Items).

Source

fn keys(&self) -> Vec<K>

The keys, in the order of enumeration (Keys).

Source

fn key_values(&self) -> Vec<(K, T)>

The keys and items, in the order of enumeration (KeyValues).

Source

fn lookup(&self, key: &K) -> Option<T>

The item of key (Lookup).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T: Clone, K: Eq + Hash + Clone> IQuery<T, K> for ChangeAwareCache<T, K>