FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    AutoPersistHelperMixins

    trait · ferroui-reactiveui · v0.5.0

    trait AutoPersistHelperMixins<T: IReactiveObject>
    

    AutoPersist: saves a reactive object when its persisted properties change, throttled on an interval (the extension members of IReactiveObject in AutoPersistHelperMixins), on its shared handle.

    The persisted properties are the ones DataContract declares; the methods of AutoPersistMetadataMixins take them as explicit metadata. Watching starts on RxSchedulers::main_thread_scheduler, and the throttle runs on RxSchedulers::task_pool_scheduler. An object that changes all the time may never be saved.

    Upstream Here
    AutoPersist(Func) auto_persist
    AutoPersist(Func, TimeSpan?) auto_persist_with_interval
    AutoPersist<TDontCare>(Func, IObservable<TDontCare>, TimeSpan?), and without the interval auto_persist_with

    View source

    Members

    auto_persist

    fn auto_persist(self: &Self, do_persist: impl Fn(Rc<T>) -> Rc<dyn IObservable<()>> + 'static) -> Rc<dyn IDisposable>
    where T: DataContract
    

    Saves the object with do_persist after its persisted properties change, with the default interval of three seconds (AutoPersist(Func<T, IObservable<Unit>>)).

    Returns the disposable that stops watching.

    Source

    auto_persist_with_interval

    fn auto_persist_with_interval(self: &Self, do_persist: impl Fn(Rc<T>) -> Rc<dyn IObservable<()>> + 'static, interval: Option<Duration>) -> Rc<dyn IDisposable>
    where T: DataContract
    

    auto_persist, throttled on interval (the default one when None) (AutoPersist(Func, TimeSpan?)).

    Source

    auto_persist_with

    fn auto_persist_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
    

    auto_persist, throttled on interval, and also whenever manual_save_signal ticks, changed or not (AutoPersist<TDontCare>(Func, IObservable<TDontCare>, TimeSpan?)).

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.