Skip to main content

diff

Function diff 

Source
pub fn diff(old: &Div, new: &Div) -> DiffResult
Expand description

Compare two Div elements and produce a DiffResult.

§Example

let old = div().w(100.0).bg(Color::RED);
let new = div().w(200.0).bg(Color::RED);

let result = diff(&old, &new);
assert!(result.changes.layout);  // Width changed
assert!(!result.changes.visual); // Background unchanged