AutoPersistCollectionMixins
trait · ferroui-reactiveui · v0.5.0
trait AutoPersistCollectionMixins<T: IReactiveObject>
AutoPersist for each item of a collection, and ActOnEveryObject (the extension members of
ObservableCollection<TItem> in AutoPersistHelperMixins): an item is saved while it is in
the collection, and no longer after it was removed.
| Upstream | Here |
|---|---|
AutoPersistCollection(Func) |
auto_persist_collection |
AutoPersistCollection(Func, TimeSpan?) |
auto_persist_collection_with_interval |
AutoPersistCollection<TDontCare>(Func, IObservable<TDontCare>, TimeSpan?), and without the interval |
auto_persist_collection_with |
ActOnEveryObject(Action<TItem>, Action<TItem>) |
act_on_every_object |
The overloads with explicit metadata are those of
AutoPersistCollectionMetadataMixins.
Members
auto_persist_collectionauto_persist_collection_with_intervalauto_persist_collection_withact_on_every_object
auto_persist_collection
fn auto_persist_collection(self: &Self, do_persist: impl Fn(Rc<T>) -> Rc<dyn IObservable<()>> + 'static) -> Rc<dyn IDisposable>
where T: DataContract
Persists each item with the default interval (AutoPersistCollection(Func)).
auto_persist_collection_with_interval
fn auto_persist_collection_with_interval(self: &Self, do_persist: impl Fn(Rc<T>) -> Rc<dyn IObservable<()>> + 'static, interval: Option<Duration>) -> Rc<dyn IDisposable>
where T: DataContract
Persists each item, throttled on interval (AutoPersistCollection(Func, TimeSpan?)).
auto_persist_collection_with
fn auto_persist_collection_with<S: 'static>(self: &Self, do_persist: impl Fn(Rc<T>) -> Rc<dyn IObservable<()>> + 'static, manual_save_signal: Rc<dyn IObservable<S>>, interval: Option<Duration>) -> Rc<dyn IDisposable>
where T: DataContract
Persists each item, throttled on interval, and whenever manual_save_signal ticks
(AutoPersistCollection<TDontCare>(Func, IObservable<TDontCare>, TimeSpan?)).
act_on_every_object
fn act_on_every_object(self: &Self, on_add: impl Fn(Rc<T>) -> () + 'static, on_remove: impl Fn(Rc<T>) -> () + 'static) -> Rc<dyn IDisposable>
Calls on_add for each item now and for each item added, and on_remove for each item
removed; a reset removes the items there were and adds the items there are. Disposing the
result stops watching and calls on_remove for every item (ActOnEveryObject).
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.