Module diff

Module diff 

Source
Expand description

Widget tree diffing for efficient UI updates.

This module provides algorithms for comparing two widget trees and computing the minimal set of operations needed to transform one into the other.

§Algorithm

The diffing algorithm works in two phases:

  1. Matching: Match widgets between old and new trees by key or position
  2. Reconciliation: Generate operations for differences

Widgets are matched by:

  • Explicit key (if set via key attribute)
  • Type + position (fallback)

Structs§

DiffNode
A node in the widget tree for diffing.
DiffResult
Result of diffing two widget trees.
TreeDiffer
Widget tree differ.

Enums§

DiffOp
Operation to apply during reconciliation.
WidgetKey
A key used to identify widgets across renders.

Functions§

diff_trees
Convenience function to diff two trees.