FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ReactiveRecord

    struct · ferroui-reactiveui · v0.5.0

    struct ReactiveRecord
    

    The part of a reactive record (ReactiveRecord): a ReactiveObject for a type with value equality. The notification state is not data: two parts are always equal, hash to nothing and print nothing, so a record that derives PartialEq, Eq, Hash and Debug compares, hashes and prints its own members only, as upstream's record does.

    Deviation (DEVIATIONS.md, ReactiveUI): a clone of the part is a new part without handlers or state, the counterpart of the copy of a record (with), which gets its own state upstream.

    use ferroui_reactiveui::{reactive_object, ReactiveRecord};
    
    #[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
    struct Point {
        reactive: ReactiveRecord,
        x: i32,
    }
    reactive_object!(Point);
    
    let first = Point { x: 1, ..Point::default() };
    let _ = first.reactive.suppress_change_notifications();
    assert_eq!(first, Point { x: 1, ..Point::default() });
    assert_eq!(format!("{first:?}"), "Point { reactive: ReactiveRecord, x: 1 }");
    

    View source

    Members

    new

    fn new() -> Self
    

    The part of a reactive record without handlers or state.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Receiver
    • Any
    • ToOwned
    • Default
    • Deref
    • AsRef<ReactiveObject>
    • Clone
    • PartialEq
    • Eq
    • Hash
    • Debug

    Availability

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