1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Public measurement proxy API for layout modifier nodes.
//!
//! This module provides the extensibility mechanism for layout modifiers to supply
//! their own measurement proxies. This enables custom layout modifiers to work with
//! the coordinator chain while respecting Rust's borrow checker constraints.
//!
//! # Architecture
//!
//! In Jetpack Compose (Kotlin), coordinators can hold direct references to live
//! modifier nodes. In Rust, we need to work around the borrow checker by extracting
//! a measurement proxy that captures the node's state at the time of measurement.
//!
//! Each `LayoutModifierNode` can optionally provide a `MeasurementProxy` via the
//! `create_measurement_proxy()` method. This proxy is a snapshot of the node's
//! configuration that can perform measurement without holding a borrow to the
//! modifier chain.
use crate::;
use LayoutModifierMeasureResult;
/// Trait for measurement proxies that can perform measurement operations
/// without holding a borrow to the modifier chain.
///
/// Measurement proxies are created by `LayoutModifierNode::create_measurement_proxy()`
/// and used by coordinators to perform measurement while avoiding borrow checker issues.