Trait taffy::tree::traits::LayoutPartialTree

source ·
pub trait LayoutPartialTree: TraversePartialTree {
    type CoreContainerStyle<'a>: CoreStyle
       where Self: 'a;

    // Required methods
    fn get_core_container_style(
        &self,
        node_id: NodeId,
    ) -> Self::CoreContainerStyle<'_>;
    fn set_unrounded_layout(&mut self, node_id: NodeId, layout: &Layout);
    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 Associated Types§

source

type CoreContainerStyle<'a>: CoreStyle where Self: 'a

The style type representing the core container styles that all containers should have Used when laying out the root node of a tree

Required Methods§

source

fn get_core_container_style( &self, node_id: NodeId, ) -> Self::CoreContainerStyle<'_>

Get core style

source

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

Set the node’s unrounded layout

source

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§