Skip to main content

IObservableCache

Trait IObservableCache 

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

A cache that can be observed and read (IObservableCache<TObject, TKey>).

Required Methods§

Source

fn count(&self) -> usize

The number of items (Count).

Source

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

The items (Items).

Source

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

The keys (Keys).

Source

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

The keys and items (KeyValues).

Source

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

The item of key (Lookup).

Trait Implementations§

Source§

impl<T, K> PartialEq for dyn IObservableCache<T, K>

Caches compare by identity (reference equality), so that they can be the items of a list.

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T: Clone + 'static, K: Eq + Hash + Clone + 'static> IObservableCache<T, K> for IntermediateCache<T, K>

Source§

impl<T: Clone + 'static, K: Eq + Hash + Clone + 'static> IObservableCache<T, K> for LockFreeObservableCache<T, K>

Source§

impl<T: Clone + 'static, K: Eq + Hash + Clone + 'static> IObservableCache<T, K> for ObservableCache<T, K>

Source§

impl<T: Clone + 'static, K: Eq + Hash + Clone + 'static> IObservableCache<T, K> for SourceCache<T, K>