Skip to main content

ISourceUpdater

Trait ISourceUpdater 

Source
pub trait ISourceUpdater<T, K>: ICacheUpdater<T, K> {
    // Required methods
    fn add_or_update_items(&mut self, items: &mut dyn Iterator<Item = T>);
    fn add_or_update_items_with(
        &mut self,
        items: &mut dyn Iterator<Item = T>,
        comparer: &dyn Fn(&T, &T) -> bool,
    );
    fn add_or_update(&mut self, item: T);
    fn add_or_update_with(&mut self, item: T, comparer: &dyn Fn(&T, &T) -> bool);
    fn load(&mut self, items: &mut dyn Iterator<Item = T>);
    fn lookup_item(&self, item: &T) -> Option<T>;
    fn refresh_items(&mut self, items: &mut dyn Iterator<Item = T>);
    fn refresh_item(&mut self, item: &T);
    fn remove_items(&mut self, items: &mut dyn Iterator<Item = T>);
    fn remove_item(&mut self, item: &T);
}
Expand description

An edit of a cache that knows the keys of its items (ISourceUpdater<TObject, TKey>).

Required Methods§

Source

fn add_or_update_items(&mut self, items: &mut dyn Iterator<Item = T>)

Adds or replaces the items (AddOrUpdate(IEnumerable<TObject>)).

Source

fn add_or_update_items_with( &mut self, items: &mut dyn Iterator<Item = T>, comparer: &dyn Fn(&T, &T) -> bool, )

Adds or replaces the items, leaving out an item equal to the item of its key (AddOrUpdate(IEnumerable<TObject>, IEqualityComparer<TObject>)).

Source

fn add_or_update(&mut self, item: T)

Adds or replaces the item (AddOrUpdate(TObject)).

Source

fn add_or_update_with(&mut self, item: T, comparer: &dyn Fn(&T, &T) -> bool)

Adds or replaces the item unless it equals the item of its key (AddOrUpdate(TObject, IEqualityComparer<TObject>)).

Source

fn load(&mut self, items: &mut dyn Iterator<Item = T>)

Replaces every item with the items (Load).

Source

fn lookup_item(&self, item: &T) -> Option<T>

The item of the key of item (Lookup(TObject)).

Source

fn refresh_items(&mut self, items: &mut dyn Iterator<Item = T>)

Refreshes the items (Refresh(IEnumerable<TObject>)).

Source

fn refresh_item(&mut self, item: &T)

Refreshes the item (Refresh(TObject)).

Source

fn remove_items(&mut self, items: &mut dyn Iterator<Item = T>)

Removes the items (Remove(IEnumerable<TObject>)).

Source

fn remove_item(&mut self, item: &T)

Removes the item (Remove(TObject)).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§