pub trait LayoutMeasurer<Key: NodeKey> {
// Required methods
fn measure(
&mut self,
node_id: Key,
node: &Node,
size: &Size2D,
) -> Option<(Size2D, Rc<dyn Any>)>;
fn should_hook_measurement(&mut self, node_id: Key) -> bool;
fn should_measure_inner_children(&mut self, node_id: Key) -> bool;
// Provided methods
fn should_post_measure(&mut self, _node_id: Key) -> bool { ... }
fn post_measure(
&mut self,
_node_id: Key,
_node_layout: &LayoutNode,
_children: &[Key],
_layout: &Torin<Key>,
) -> PostMeasure<Key> { ... }
fn notify_layout_references(
&mut self,
_node_id: Key,
_area: Area,
_visible_area: Area,
_inner_sizes: Size2D,
) { ... }
}Required Methods§
fn measure( &mut self, node_id: Key, node: &Node, size: &Size2D, ) -> Option<(Size2D, Rc<dyn Any>)>
fn should_hook_measurement(&mut self, node_id: Key) -> bool
fn should_measure_inner_children(&mut self, node_id: Key) -> bool
Provided Methods§
Sourcefn should_post_measure(&mut self, _node_id: Key) -> bool
fn should_post_measure(&mut self, _node_id: Key) -> bool
Whether LayoutMeasurer::post_measure should run for this node.
Sourcefn post_measure(
&mut self,
_node_id: Key,
_node_layout: &LayoutNode,
_children: &[Key],
_layout: &Torin<Key>,
) -> PostMeasure<Key>
fn post_measure( &mut self, _node_id: Key, _node_layout: &LayoutNode, _children: &[Key], _layout: &Torin<Key>, ) -> PostMeasure<Key>
Runs after a node and its children are measured.