[−][src]Trait polyhorn_ios::layout::Algorithm
Abstract interface of a flexbox algorithm.
Associated Types
Loading content...Required methods
fn new() -> Self
Create a new instance of the flexbox (i.e. root).
fn new_node(&mut self, style: ViewStyle, children: &[Self::Node]) -> Self::Node
Create a new node with the given child nodes.
fn new_leaf(&mut self, style: ViewStyle, measure: MeasureFunc) -> Self::Node
Create a new leaf with an intrinsic content size that is determined by the given measure function.
fn add_child(&mut self, parent: Self::Node, child: Self::Node)
Add a child node to a parent node.
fn remove_child(&mut self, parent: Self::Node, child: Self::Node)
Remove a child node from a parent node.
fn child_count(&self, parent: Self::Node) -> usize
Returns the number of child nodes of a specific parent node.
fn remove(&mut self, node: Self::Node)
Removes the given node from this flexbox.
fn set_style(&mut self, node: Self::Node, style: ViewStyle)
Updates the style of a specific node within this flexbox.
fn set_measure(&mut self, node: Self::Node, measure: MeasureFunc)
Updates the measure function of a specific node within this flexbox.
fn compute_layout(&mut self, node: Self::Node, size: Size<Dimension<f32>>)
Computes the layout of a node within this flexbox within the given size.
fn layout(&self, node: Self::Node) -> Layout
Returns the computed layout of a node within this flexbox.
Implementors
impl Algorithm for Flexbox
[src]
type Node = Node
fn new() -> Flexbox
[src]
fn new_node(
&mut self,
style: ViewStyle,
children: &[<Flexbox as Algorithm>::Node]
) -> <Flexbox as Algorithm>::Node
[src]
&mut self,
style: ViewStyle,
children: &[<Flexbox as Algorithm>::Node]
) -> <Flexbox as Algorithm>::Node
fn new_leaf(
&mut self,
style: ViewStyle,
measure: MeasureFunc
) -> <Flexbox as Algorithm>::Node
[src]
&mut self,
style: ViewStyle,
measure: MeasureFunc
) -> <Flexbox as Algorithm>::Node
fn add_child(
&mut self,
parent: <Flexbox as Algorithm>::Node,
child: <Flexbox as Algorithm>::Node
)
[src]
&mut self,
parent: <Flexbox as Algorithm>::Node,
child: <Flexbox as Algorithm>::Node
)
fn remove_child(
&mut self,
parent: <Flexbox as Algorithm>::Node,
child: <Flexbox as Algorithm>::Node
)
[src]
&mut self,
parent: <Flexbox as Algorithm>::Node,
child: <Flexbox as Algorithm>::Node
)
fn child_count(&self, parent: <Flexbox as Algorithm>::Node) -> usize
[src]
fn remove(&mut self, node: <Flexbox as Algorithm>::Node)
[src]
fn set_style(&mut self, node: <Flexbox as Algorithm>::Node, style: ViewStyle)
[src]
fn set_measure(
&mut self,
node: <Flexbox as Algorithm>::Node,
measure: MeasureFunc
)
[src]
&mut self,
node: <Flexbox as Algorithm>::Node,
measure: MeasureFunc
)
fn compute_layout(
&mut self,
node: <Flexbox as Algorithm>::Node,
size: Size<Dimension<f32>>
)
[src]
&mut self,
node: <Flexbox as Algorithm>::Node,
size: Size<Dimension<f32>>
)