pub struct TaffyTree<'a, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,{
pub composer: &'a mut Composer<T>,
pub measure_function: M,
}
Fields§
§composer: &'a mut Composer<T>
§measure_function: M
Implementations§
Trait Implementations§
Source§impl<T, M> CacheTree for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
impl<T, M> CacheTree for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
Source§fn cache_get(
&self,
node_id: NodeId,
known_dimensions: Size<Option<f32>>,
available_space: Size<AvailableSpace>,
run_mode: RunMode,
) -> Option<LayoutOutput>
fn cache_get( &self, node_id: NodeId, known_dimensions: Size<Option<f32>>, available_space: Size<AvailableSpace>, run_mode: RunMode, ) -> Option<LayoutOutput>
Try to retrieve a cached result from the cache
Source§fn cache_store(
&mut self,
node_id: NodeId,
known_dimensions: Size<Option<f32>>,
available_space: Size<AvailableSpace>,
run_mode: RunMode,
layout_output: LayoutOutput,
)
fn cache_store( &mut self, node_id: NodeId, known_dimensions: Size<Option<f32>>, available_space: Size<AvailableSpace>, run_mode: RunMode, layout_output: LayoutOutput, )
Store a computed size in the cache
Source§fn cache_clear(&mut self, node_id: NodeId)
fn cache_clear(&mut self, node_id: NodeId)
Clear all cache entries for the node
Source§impl<T, M> LayoutBlockContainer for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
impl<T, M> LayoutBlockContainer for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
Source§type BlockContainerStyle<'a> = <T as TaffyNode>::BlockContainerStyle<'a>
where
Self: 'a
type BlockContainerStyle<'a> = <T as TaffyNode>::BlockContainerStyle<'a> where Self: 'a
The style type representing the CSS Block container’s styles
Source§type BlockItemStyle<'a> = <T as TaffyNode>::BlockItemStyle<'a>
where
Self: 'a
type BlockItemStyle<'a> = <T as TaffyNode>::BlockItemStyle<'a> where Self: 'a
The style type representing each CSS Block item’s styles
Source§fn get_block_container_style(
&self,
node_id: NodeId,
) -> Self::BlockContainerStyle<'_>
fn get_block_container_style( &self, node_id: NodeId, ) -> Self::BlockContainerStyle<'_>
Get the container’s styles
Source§fn get_block_child_style(&self, node_id: NodeId) -> Self::BlockItemStyle<'_>
fn get_block_child_style(&self, node_id: NodeId) -> Self::BlockItemStyle<'_>
Get the child’s styles
Source§impl<T, M> LayoutFlexboxContainer for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
impl<T, M> LayoutFlexboxContainer for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
Source§type FlexboxContainerStyle<'a> = <T as TaffyNode>::FlexboxContainerStyle<'a>
where
Self: 'a
type FlexboxContainerStyle<'a> = <T as TaffyNode>::FlexboxContainerStyle<'a> where Self: 'a
The style type representing the Flexbox container’s styles
Source§type FlexboxItemStyle<'a> = <T as TaffyNode>::FlexboxItemStyle<'a>
where
Self: 'a
type FlexboxItemStyle<'a> = <T as TaffyNode>::FlexboxItemStyle<'a> where Self: 'a
The style type representing each Flexbox item’s styles
Source§fn get_flexbox_container_style(
&self,
node_id: NodeId,
) -> Self::FlexboxContainerStyle<'_>
fn get_flexbox_container_style( &self, node_id: NodeId, ) -> Self::FlexboxContainerStyle<'_>
Get the container’s styles
Source§fn get_flexbox_child_style(&self, node_id: NodeId) -> Self::FlexboxItemStyle<'_>
fn get_flexbox_child_style(&self, node_id: NodeId) -> Self::FlexboxItemStyle<'_>
Get the child’s styles
Source§impl<T, M> LayoutGridContainer for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
impl<T, M> LayoutGridContainer for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
Source§type GridContainerStyle<'a> = <T as TaffyNode>::GridContainerStyle<'a>
where
Self: 'a
type GridContainerStyle<'a> = <T as TaffyNode>::GridContainerStyle<'a> where Self: 'a
The style type representing the CSS Grid container’s styles
Source§type GridItemStyle<'a> = <T as TaffyNode>::GridItemStyle<'a>
where
Self: 'a
type GridItemStyle<'a> = <T as TaffyNode>::GridItemStyle<'a> where Self: 'a
The style type representing each CSS Grid item’s styles
Source§fn get_grid_container_style(
&self,
node_id: NodeId,
) -> Self::GridContainerStyle<'_>
fn get_grid_container_style( &self, node_id: NodeId, ) -> Self::GridContainerStyle<'_>
Get the container’s styles
Source§fn get_grid_child_style(&self, node_id: NodeId) -> Self::GridItemStyle<'_>
fn get_grid_child_style(&self, node_id: NodeId) -> Self::GridItemStyle<'_>
Get the child’s styles
Source§impl<T, M> LayoutPartialTree for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
impl<T, M> LayoutPartialTree for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
Source§type CoreContainerStyle<'a> = &'a <T as TaffyNode>::CoreContainerStyle
where
Self: 'a
type CoreContainerStyle<'a> = &'a <T as TaffyNode>::CoreContainerStyle 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
Source§fn get_core_container_style(
&self,
node_id: NodeId,
) -> Self::CoreContainerStyle<'_>
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)
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
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
Source§impl<T, M> PrintTree for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
impl<T, M> PrintTree for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
Source§fn get_debug_label(&self, node_id: NodeId) -> &'static str
fn get_debug_label(&self, node_id: NodeId) -> &'static str
Get a debug label for the node (typically the type of node: flexbox, grid, text, image, etc)
Source§fn get_final_layout(&self, node_id: NodeId) -> &Layout
fn get_final_layout(&self, node_id: NodeId) -> &Layout
Get a reference to the node’s final layout
Source§impl<T, M> RoundTree for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
impl<T, M> RoundTree for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
Source§fn get_unrounded_layout(&self, node_id: NodeId) -> &Layout
fn get_unrounded_layout(&self, node_id: NodeId) -> &Layout
Get the node’s unrounded layout
Source§fn set_final_layout(&mut self, node_id: NodeId, layout: &Layout)
fn set_final_layout(&mut self, node_id: NodeId, layout: &Layout)
Get a reference to the node’s final layout
Source§impl<T, M> TraversePartialTree for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
impl<T, M> TraversePartialTree for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
Source§type ChildIter<'a> = TaffyTreeChildIter<'a>
where
Self: 'a
type ChildIter<'a> = TaffyTreeChildIter<'a> where Self: 'a
Type representing an iterator of the children of a node
Source§fn child_ids(&self, node_id: NodeId) -> Self::ChildIter<'_>
fn child_ids(&self, node_id: NodeId) -> Self::ChildIter<'_>
Get the list of children IDs for the given node
Source§fn child_count(&self, node_id: NodeId) -> usize
fn child_count(&self, node_id: NodeId) -> usize
Get the number of children for the given node
impl<T, M> TraverseTree for TaffyTree<'_, T, M>where
T: TaffyNode,
T::Context: TaffyConfig,
M: FnMut(Size<Option<f32>>, Size<AvailableSpace>, NodeId, Option<&mut T::NodeContext>, &T::CoreContainerStyle) -> Size<f32>,
Auto Trait Implementations§
impl<'a, T, M> Freeze for TaffyTree<'a, T, M>where
M: Freeze,
impl<'a, T, M> !RefUnwindSafe for TaffyTree<'a, T, M>
impl<'a, T, M> !Send for TaffyTree<'a, T, M>
impl<'a, T, M> !Sync for TaffyTree<'a, T, M>
impl<'a, T, M> Unpin for TaffyTree<'a, T, M>where
M: Unpin,
impl<'a, T, M> !UnwindSafe for TaffyTree<'a, T, M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more