FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ToPropertyMixins

    trait · ferroui-reactiveui · v0.5.0

    trait ToPropertyMixins<T: Clone + PartialEq + 'static>
    

    ToProperty: makes an ObservableAsPropertyHelper that follows the sequence and raises the change notifications of a property of its owner; implemented for Rc<dyn IObservable<T>>.

    The property is named by a path (prop!(VM => full_name)), whose name is the one raised. The helper raises PropertyChanging and PropertyChanged through IReactiveObject's raising methods, so the suppression and the delay of the notifications apply. The owner is held weakly.

    Upstream's forms with an out parameter return the helper as the other forms do, so they are these; a view model stores the helper (in a OnceCell or a RefCell<Option<..>>) and reads value in its getter.

    View source

    Members

    to_property

    fn to_property<VM: IReactiveObject>(self: Self, owner: &Rc<VM>, path: PropertyPath<Rc<VM>, T>) -> ObservableAsPropertyHelper<T>
    where T: Default
    

    The helper of the property path of owner, from the default value of T (ToProperty(TObj, Func<TObj, TRet>)).

    Source

    to_property_deferred

    fn to_property_deferred<VM: IReactiveObject>(self: Self, owner: &Rc<VM>, path: PropertyPath<Rc<VM>, T>, defer_subscription: bool) -> ObservableAsPropertyHelper<T>
    where T: Default
    

    to_property that subscribes on the first read of the value when defer_subscription is set (ToProperty(TObj, Func<TObj, TRet>, bool)).

    Source

    to_property_on

    fn to_property_on<VM: IReactiveObject>(self: Self, owner: &Rc<VM>, path: PropertyPath<Rc<VM>, T>, scheduler: Option<Rc<dyn IScheduler>>) -> ObservableAsPropertyHelper<T>
    where T: Default
    

    to_property that delivers the values on scheduler (ToProperty(TObj, Func<TObj, TRet>, ISequencer?)).

    Source

    to_property_deferred_on

    fn to_property_deferred_on<VM: IReactiveObject>(self: Self, owner: &Rc<VM>, path: PropertyPath<Rc<VM>, T>, defer_subscription: bool, scheduler: Option<Rc<dyn IScheduler>>) -> ObservableAsPropertyHelper<T>
    where T: Default
    

    to_property with both options (ToProperty(TObj, Func<TObj, TRet>, bool, ISequencer?)).

    Source

    to_property_with_initial_value

    fn to_property_with_initial_value<VM: IReactiveObject>(self: Self, owner: &Rc<VM>, path: PropertyPath<Rc<VM>, T>, initial_value: T) -> ObservableAsPropertyHelper<T>
    

    The helper starting from initial_value (ToProperty(TObj, Func<TObj, TRet>, TRet)).

    Source

    to_property_with

    fn to_property_with<VM: IReactiveObject>(self: Self, owner: &Rc<VM>, path: PropertyPath<Rc<VM>, T>, initial_value: ObservableAsPropertyInitialValue<T>, defer_subscription: bool, scheduler: Option<Rc<dyn IScheduler>>) -> ObservableAsPropertyHelper<T>
    

    The helper with every option: the initial value or its factory, the deferred subscription and the scheduler (the forms with TRet initialValue or Func<TRet> getInitialValue, bool deferSubscription and ISequencer? scheduler).

    Source

    to_property_by_name

    fn to_property_by_name<VM: IReactiveObject>(self: Self, owner: &Rc<VM>, property_name: &str, initial_value: ObservableAsPropertyInitialValue<T>, defer_subscription: bool, scheduler: Option<Rc<dyn IScheduler>>) -> ObservableAsPropertyHelper<T>
    

    The helper of the property named property_name, with every option (the forms that name the property with a string, nameof(Property)).

    Source

    Trait implementations

    Availability

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