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§
Sourcefn add_or_update_items(&mut self, items: &mut dyn Iterator<Item = T>)
fn add_or_update_items(&mut self, items: &mut dyn Iterator<Item = T>)
Adds or replaces the items (AddOrUpdate(IEnumerable<TObject>)).
Sourcefn add_or_update_items_with(
&mut self,
items: &mut dyn Iterator<Item = T>,
comparer: &dyn Fn(&T, &T) -> bool,
)
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>)).
Sourcefn add_or_update(&mut self, item: T)
fn add_or_update(&mut self, item: T)
Adds or replaces the item (AddOrUpdate(TObject)).
Sourcefn add_or_update_with(&mut self, item: T, comparer: &dyn Fn(&T, &T) -> bool)
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>)).
Sourcefn load(&mut self, items: &mut dyn Iterator<Item = T>)
fn load(&mut self, items: &mut dyn Iterator<Item = T>)
Replaces every item with the items (Load).
Sourcefn lookup_item(&self, item: &T) -> Option<T>
fn lookup_item(&self, item: &T) -> Option<T>
The item of the key of item (Lookup(TObject)).
Sourcefn refresh_items(&mut self, items: &mut dyn Iterator<Item = T>)
fn refresh_items(&mut self, items: &mut dyn Iterator<Item = T>)
Refreshes the items (Refresh(IEnumerable<TObject>)).
Sourcefn refresh_item(&mut self, item: &T)
fn refresh_item(&mut self, item: &T)
Refreshes the item (Refresh(TObject)).
Sourcefn remove_items(&mut self, items: &mut dyn Iterator<Item = T>)
fn remove_items(&mut self, items: &mut dyn Iterator<Item = T>)
Removes the items (Remove(IEnumerable<TObject>)).
Sourcefn remove_item(&mut self, item: &T)
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".