Trait lay_rs::prelude::taffy::LayoutPartialTree

pub trait LayoutPartialTree: TraversePartialTree {
    // Required methods
    fn get_style(&self, node_id: NodeId) -> &Style;
    fn set_unrounded_layout(&mut self, node_id: NodeId, layout: &Layout);
    fn get_cache_mut(&mut self, node_id: NodeId) -> &mut Cache;
    fn compute_child_layout(
        &mut self,
        node_id: NodeId,
        inputs: LayoutInput,
    ) -> LayoutOutput;
}
Expand description

Any type that implements LayoutPartialTree can be laid out using Taffy’s algorithms

Note that this trait extends TraversePartialTree (not TraverseTree). Taffy’s algorithm implementations have been designed such that they can be used for a laying out a single node that only has access to it’s immediate children.

Required Methods§

fn get_style(&self, node_id: NodeId) -> &Style

Get a reference to the Style for this node.

fn set_unrounded_layout(&mut self, node_id: NodeId, layout: &Layout)

Set the node’s unrounded layout

fn get_cache_mut(&mut self, node_id: NodeId) -> &mut Cache

Get a mutable reference to the Cache for this node.

fn compute_child_layout( &mut self, node_id: NodeId, inputs: LayoutInput, ) -> LayoutOutput

Compute the specified node’s size or full layout given the specified constraints

Object Safety§

This trait is not object safe.

Implementors§