pub struct TaffyStoreLayout { /* private fields */ }Implementations§
Source§impl TaffyStoreLayout
impl TaffyStoreLayout
pub fn layout_generation(&self) -> u64
pub fn set_text_measurer(&mut self, measurer: Arc<dyn TextMeasurer>)
pub fn text_measurer(&self) -> &Arc<dyn TextMeasurer> ⓘ
Sourcepub fn register_measure_hook(
&mut self,
slot: TableSlot,
hook: Arc<dyn LeafMeasureHook>,
) -> bool
pub fn register_measure_hook( &mut self, slot: TableSlot, hook: Arc<dyn LeafMeasureHook>, ) -> bool
Registers an intrinsic LeafMeasureHook for nodes carrying slot, invalidating cached
layout entries so subsequent passes invoke it, and returns true if a prior hook at
slot was replaced.
pub fn paragraphs(&self) -> &ParagraphStore
pub fn layout_of(&self, id: NodeId) -> Option<LayoutRect>
pub fn resolved_rtl(&self, id: NodeId) -> bool
pub fn resolved_text(&self, id: NodeId) -> ResolvedTextStyle
pub fn resolved_container_env(&self, id: NodeId) -> ContainerEnv
Sourcepub fn has_container_scopes(&self) -> bool
pub fn has_container_scopes(&self) -> bool
Whether per-node container scope buffers are currently allocated.
Sourcepub fn has_boundary_records(&self) -> bool
pub fn has_boundary_records(&self) -> bool
Whether per-node relayout-boundary buffers are currently allocated (0 B without
ContainerType::Size nodes).
Sourcepub fn top_layer(&self) -> &TopLayerIndex
pub fn top_layer(&self) -> &TopLayerIndex
The top-layer index this engine hoists overlays from.
Sourcepub fn changed_rects(&self) -> Option<&[NodeId]>
pub fn changed_rects(&self) -> Option<&[NodeId]>
Exact set of reachable live nodes whose committed LayoutRect changed or became newly
laid out in the latest layout pass (Some(&[]) on a clean frame), or None when callers
must scan all live nodes (e.g. dead root or top_layer_rerun fallback).
Sourcepub fn inherit_walk_count(&self) -> u64
pub fn inherit_walk_count(&self) -> u64
Completed inheritance walks (both full-tree and subtree-scoped).
Sourcepub fn full_inherit_walk_count(&self) -> u64
pub fn full_inherit_walk_count(&self) -> u64
Completed full-tree inheritance walks from root.
Sourcepub fn inherit_nodes_visited(&self) -> u64
pub fn inherit_nodes_visited(&self) -> u64
Total box nodes processed across all inheritance walks.
Sourcepub fn boundary_pass_count(&self) -> u64
pub fn boundary_pass_count(&self) -> u64
Completed relayout-containment boundary fast-path passes.
Sourcepub fn measure_root(
&mut self,
store: &NodeStore,
root: NodeId,
constraints: SizeConstraints,
ideal: bool,
) -> SurfaceMeasure
pub fn measure_root( &mut self, store: &NodeStore, root: NodeId, constraints: SizeConstraints, ideal: bool, ) -> SurfaceMeasure
Measures root under constraints (or unconstrained intrinsic sizing when ideal is
true) into isolated dry-run scratch without mutating committed caches, boxes, rects,
hoisted out-of-flow lists, resolved inheritance, last_viewport, or layout_dirty.
Sourcepub fn set_capture_box_edges(&mut self, enabled: bool)
pub fn set_capture_box_edges(&mut self, enabled: bool)
Enables or disables opt-in capture of exact Taffy resolved margin/border/padding/
content_size into self.box_edges.
Turning capture OFF clears and shrinks box_edges to capacity() == 0 (0 B).
Turning capture ON invalidates Taffy caches and marks layout dirty so the next
compute_layout populates exact edges for every live node.
pub fn capture_box_edges(&self) -> bool
Sourcepub fn box_edges_capacity(&self) -> usize
pub fn box_edges_capacity(&self) -> usize
Returns the allocated slot capacity of the opt-in box_edges buffer (guaranteed 0 when
capture is disabled).
pub fn box_edges_of(&self, id: NodeId) -> Option<ResolvedBoxEdges>
Source§impl TaffyStoreLayout
impl TaffyStoreLayout
Sourcepub fn set_media_env(&mut self, env: MediaEnv) -> bool
pub fn set_media_env(&mut self, env: MediaEnv) -> bool
Updates the active MediaEnv; returns true when it changed.
pub fn media_env(&self) -> MediaEnv
Sourcepub fn visit_responsive_patches<'a>(
&self,
store: &'a NodeStore,
id: NodeId,
f: &mut dyn FnMut(ConditionalTier, RowPatchView<'a>),
)
pub fn visit_responsive_patches<'a>( &self, store: &'a NodeStore, id: NodeId, f: &mut dyn FnMut(ConditionalTier, RowPatchView<'a>), )
Visits id’s matching @media then @container patches under the last committed pass.
pub fn responsive_node_count(&self) -> u32
pub fn container_node_count(&self) -> u32
Source§impl TaffyStoreLayout
impl TaffyStoreLayout
Sourcepub fn sync_changes(&mut self, store: &NodeStore, changes: &ChangeSet)
pub fn sync_changes(&mut self, store: &NodeStore, changes: &ChangeSet)
Invalidates cached Taffy entries for all layout/measure/structural changes in changes.
pub fn sync_changes_with_interaction( &mut self, store: &NodeStore, changes: &ChangeSet, interaction: Option<&InteractionTracker>, )
pub fn sync_interaction_paragraphs( &mut self, store: &NodeStore, interaction: &InteractionTracker, dirty_nodes: &[NodeId], ) -> (&[NodeId], &[NodeId])
Sourcepub fn invalidate_all(&mut self, store: &NodeStore)
pub fn invalidate_all(&mut self, store: &NodeStore)
Marks every live node dirty (used after full replica load or measurer swap).
Source§impl TaffyStoreLayout
impl TaffyStoreLayout
pub fn new() -> Self
pub fn reset(&mut self)
Sourcepub fn compute_layout(
&mut self,
store: &NodeStore,
root: NodeId,
viewport: Viewport,
) -> bool
pub fn compute_layout( &mut self, store: &NodeStore, root: NodeId, viewport: Viewport, ) -> bool
Computes layout for root at viewport directly from store columns, self-gated per the
[StoreLayoutEngine::compute_layout] contract: returns false without a pass when
nothing was invalidated since the last one, true when rects may have changed.
pub fn compute_layout_with_interaction( &mut self, store: &NodeStore, root: NodeId, viewport: Viewport, interaction: Option<&InteractionTracker>, ) -> bool
Trait Implementations§
Source§impl Default for TaffyStoreLayout
impl Default for TaffyStoreLayout
Source§impl StoreLayoutEngine for TaffyStoreLayout
impl StoreLayoutEngine for TaffyStoreLayout
Source§fn sync_changes(&mut self, store: &NodeStore, changes: &ChangeSet)
fn sync_changes(&mut self, store: &NodeStore, changes: &ChangeSet)
changes. Read moreSource§fn top_layer(&self) -> &TopLayerIndex
fn top_layer(&self) -> &TopLayerIndex
Self::sync_changes it covers every store slot (TopLayerIndex::sync guarantees
it); the runtime publishes its states() zero-copy as the top_layer_states scene fact.Source§fn sync_changes_with_interaction(
&mut self,
store: &NodeStore,
changes: &ChangeSet,
interaction: Option<&InteractionTracker>,
)
fn sync_changes_with_interaction( &mut self, store: &NodeStore, changes: &ChangeSet, interaction: Option<&InteractionTracker>, )
Self::sync_changes that also resolves active :hover/:active state rules
on inline paragraph runs.Source§fn compute_layout_with_interaction(
&mut self,
store: &NodeStore,
root: NodeId,
viewport: Viewport,
interaction: Option<&InteractionTracker>,
) -> bool
fn compute_layout_with_interaction( &mut self, store: &NodeStore, root: NodeId, viewport: Viewport, interaction: Option<&InteractionTracker>, ) -> bool
Self::compute_layout that threads active InteractionTracker state into
compiled paragraph runs when deferred inheritance runs.Source§fn sync_interaction_paragraphs(
&mut self,
store: &NodeStore,
interaction: &InteractionTracker,
dirty_nodes: &[NodeId],
) -> (&[NodeId], &[NodeId])
fn sync_interaction_paragraphs( &mut self, store: &NodeStore, interaction: &InteractionTracker, dirty_nodes: &[NodeId], ) -> (&[NodeId], &[NodeId])
dirty_nodes after an interactive pseudo-state change
(:hover/:active/:focus). Returns (layout_dirty_paragraphs, paint_dirty_paragraphs).Source§fn paragraphs(&self) -> Option<&ParagraphStore>
fn paragraphs(&self) -> Option<&ParagraphStore>
Source§fn paragraphs_mut(&mut self) -> Option<&mut ParagraphStore>
fn paragraphs_mut(&mut self) -> Option<&mut ParagraphStore>
ParagraphStore (used to lock capacity before publish).Source§fn measure_root(
&mut self,
store: &NodeStore,
root: NodeId,
constraints: SizeConstraints,
ideal: bool,
) -> SurfaceMeasure
fn measure_root( &mut self, store: &NodeStore, root: NodeId, constraints: SizeConstraints, ideal: bool, ) -> SurfaceMeasure
root under constraints (or unconstrained intrinsic sizing when ideal is
true) without mutating committed layout boxes, published rects, or viewport state.Source§fn layout_of(&self, id: NodeId) -> Option<LayoutRect>
fn layout_of(&self, id: NodeId) -> Option<LayoutRect>
id from the latest pass, if live.Source§fn changed_rects(&self) -> Option<&[NodeId]>
fn changed_rects(&self) -> Option<&[NodeId]>
Self::layout_of changed (bitwise) or
became newly laid out during the latest Self::compute_layout pass, or None when the
full delta is unavailable and callers must fall back to scanning all live nodes. Read moreSource§fn set_capture_box_edges(&mut self, enabled: bool)
fn set_capture_box_edges(&mut self, enabled: bool)
margin/border/padding/
content_size) for the Visual Layout Inspector. Disabled by default (0 B overhead).Source§fn capture_box_edges(&self) -> bool
fn capture_box_edges(&self) -> bool
Source§fn box_edges_of(&self, id: NodeId) -> Option<ResolvedBoxEdges>
fn box_edges_of(&self, id: NodeId) -> Option<ResolvedBoxEdges>
id from the latest layout pass when opt-in
capture is enabled, or None when disabled or unsupported by this engine.Source§fn set_text_measurer(&mut self, measurer: Arc<dyn TextMeasurer>)
fn set_text_measurer(&mut self, measurer: Arc<dyn TextMeasurer>)
Source§fn register_measure_hook(
&mut self,
slot: TableSlot,
hook: Arc<dyn LeafMeasureHook>,
) -> bool
fn register_measure_hook( &mut self, slot: TableSlot, hook: Arc<dyn LeafMeasureHook>, ) -> bool
LeafMeasureHook for nodes carrying slot, invalidating cached
layout entries, and returns true if a prior hook at slot was replaced. Engines without
leaf-hook support ignore it and return false by default.Source§fn set_media_env(&mut self, env: MediaEnv) -> bool
fn set_media_env(&mut self, env: MediaEnv) -> bool
@media environment (compute_layout supplies the viewport size). Returns true
when it changed. Engines without responsive support ignore it.Source§fn visit_responsive_patches<'a>(
&self,
store: &'a NodeStore,
id: NodeId,
f: &mut dyn FnMut(ConditionalTier, RowPatchView<'a>),
)
fn visit_responsive_patches<'a>( &self, store: &'a NodeStore, id: NodeId, f: &mut dyn FnMut(ConditionalTier, RowPatchView<'a>), )
id’s matching @media then @container rule patches (cascade order) under the
environment of the last committed pass. Engines without responsive support visit nothing.Source§fn responsive_epoch(&self) -> u64
fn responsive_epoch(&self) -> u64
@container env changed). Caches of derived style (e.g.
stacking plans) key on it. Engines without responsive support stay at 0.id’s Responsive::show_on gate fails under the engine’s @media environment
(display: none that beats every rule). Engines without responsive support never hide.Auto Trait Implementations§
impl !Freeze for TaffyStoreLayout
impl !RefUnwindSafe for TaffyStoreLayout
impl !UnwindSafe for TaffyStoreLayout
impl Forget for TaffyStoreLayout
impl Move for TaffyStoreLayout
impl Send for TaffyStoreLayout
impl Sync for TaffyStoreLayout
impl Unpin for TaffyStoreLayout
impl UnsafeUnpin for TaffyStoreLayoutwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Cache>: UnsafeUnpin,
PhantomData<UnroundedBox>: UnsafeUnpin,
PhantomData<ResolvedBoxEdges>: UnsafeUnpin,
PhantomData<LayoutRect>: UnsafeUnpin,
PhantomData<u64>: UnsafeUnpin,
PhantomData<u16>: UnsafeUnpin,
PhantomData<bool>: UnsafeUnpin,
PhantomData<TextStyle<ResolvedFamily>>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
PhantomData<NodeId>: UnsafeUnpin,
PhantomData<NvParagraphSpan>: UnsafeUnpin,
PhantomData<ParagraphMeta>: UnsafeUnpin,
PhantomData<NvTextRun>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<InlineDfsFrame>: UnsafeUnpin,
PhantomData<TopLayerState>: UnsafeUnpin,
PhantomData<(NodeId, TopLayerState)>: UnsafeUnpin,
PhantomData<ChildIndex>: UnsafeUnpin,
PhantomData<Candidate>: UnsafeUnpin,
PhantomData<ListSpan>: UnsafeUnpin,
*const ArcInner<dyn TextMeasurer> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn TextMeasurer>>: UnsafeUnpin,
*const SlotStorage<Arc<dyn LeafMeasureHook>> is !null: UnsafeUnpin,
PhantomData<SlotStorage<Arc<dyn LeafMeasureHook>>>: UnsafeUnpin,
PhantomData<(NodeId, bool, TextStyle<ResolvedFamily>)>: UnsafeUnpin,
PhantomData<RoundFrame>: UnsafeUnpin,
PhantomData<NodeStyleFlags>: UnsafeUnpin,
PhantomData<f32>: UnsafeUnpin,
PhantomData<RespMemoSlot>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
PhantomData<RefCell<(u64, Option<ResolvedResponsiveStyle>)>>: UnsafeUnpin,
PhantomData<(SlotTag, ContainerRecord)>: UnsafeUnpin,
PhantomData<(SlotTag, BoundaryRecord)>: UnsafeUnpin,
PhantomData<(SlotTag, ContainerEnv)>: UnsafeUnpin,
PhantomData<(SlotTag, (u64, u64))>: UnsafeUnpin,
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
Source§impl<L> ResponsivePatches for Lwhere
L: StoreLayoutEngine + ?Sized,
impl<L> ResponsivePatches for Lwhere
L: StoreLayoutEngine + ?Sized,
fn visit_responsive_patches<'a>( &self, store: &'a NodeStore, id: NodeId, f: &mut dyn FnMut(ConditionalTier, RowPatchView<'a>), )
id’s show_on gate fails (display: none beating every rule, like Web’s !important).