Skip to main content

TaffyStoreLayout

Struct TaffyStoreLayout 

Source
pub struct TaffyStoreLayout { /* private fields */ }

Implementations§

Source§

impl TaffyStoreLayout

Source

pub fn layout_generation(&self) -> u64

Source

pub fn set_text_measurer(&mut self, measurer: Arc<dyn TextMeasurer>)

Source

pub fn text_measurer(&self) -> &Arc<dyn TextMeasurer> ⓘ

Source

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.

Source

pub fn paragraphs(&self) -> &ParagraphStore

Source

pub fn layout_of(&self, id: NodeId) -> Option<LayoutRect>

Source

pub fn resolved_rtl(&self, id: NodeId) -> bool

Source

pub fn resolved_text(&self, id: NodeId) -> ResolvedTextStyle

Source

pub fn resolved_container_env(&self, id: NodeId) -> ContainerEnv

Source

pub fn has_container_scopes(&self) -> bool

Whether per-node container scope buffers are currently allocated.

Source

pub fn has_boundary_records(&self) -> bool

Whether per-node relayout-boundary buffers are currently allocated (0 B without ContainerType::Size nodes).

Source

pub fn top_layer(&self) -> &TopLayerIndex

The top-layer index this engine hoists overlays from.

Source

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).

Source

pub fn inherit_walk_count(&self) -> u64

Completed inheritance walks (both full-tree and subtree-scoped).

Source

pub fn full_inherit_walk_count(&self) -> u64

Completed full-tree inheritance walks from root.

Source

pub fn inherit_nodes_visited(&self) -> u64

Total box nodes processed across all inheritance walks.

Source

pub fn boundary_pass_count(&self) -> u64

Completed relayout-containment boundary fast-path passes.

Source

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.

Source

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.

Source

pub fn capture_box_edges(&self) -> bool

Source

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).

Source

pub fn box_edges_of(&self, id: NodeId) -> Option<ResolvedBoxEdges>

Source§

impl TaffyStoreLayout

Source

pub fn set_media_env(&mut self, env: MediaEnv) -> bool

Updates the active MediaEnv; returns true when it changed.

Source

pub fn media_env(&self) -> MediaEnv

Source

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.

Source

pub fn responsive_node_count(&self) -> u32

Source

pub fn container_node_count(&self) -> u32

Source§

impl TaffyStoreLayout

Source

pub fn sync_changes(&mut self, store: &NodeStore, changes: &ChangeSet)

Invalidates cached Taffy entries for all layout/measure/structural changes in changes.

Source

pub fn sync_changes_with_interaction( &mut self, store: &NodeStore, changes: &ChangeSet, interaction: Option<&InteractionTracker>, )

Source

pub fn sync_interaction_paragraphs( &mut self, store: &NodeStore, interaction: &InteractionTracker, dirty_nodes: &[NodeId], ) -> (&[NodeId], &[NodeId])

Source

pub fn invalidate_all(&mut self, store: &NodeStore)

Marks every live node dirty (used after full replica load or measurer swap).

Source§

impl TaffyStoreLayout

Source

pub fn new() -> Self

Source

pub fn reset(&mut self)

Source

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.

Source

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

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl StoreLayoutEngine for TaffyStoreLayout

Source§

fn name(&self) -> &'static str

Human-readable engine identifier (e.g. "taffy", "yoga").
Source§

fn sync_changes(&mut self, store: &NodeStore, changes: &ChangeSet)

Invalidates cached layout entries for every layout/measure/structural change in changes. Read more
Source§

fn top_layer(&self) -> &TopLayerIndex

The engine’s top-layer index: the single source of which overlay roots are hoisted. After every 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>, )

Variant of Self::sync_changes that also resolves active :hover/:active state rules on inline paragraph runs.
Source§

fn compute_layout( &mut self, store: &NodeStore, root: NodeId, viewport: Viewport, ) -> bool

Computes layout for root at viewport directly from store word columns. Read more
Source§

fn compute_layout_with_interaction( &mut self, store: &NodeStore, root: NodeId, viewport: Viewport, interaction: Option<&InteractionTracker>, ) -> bool

Variant of 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])

Recompiles only paragraphs owning dirty_nodes after an interactive pseudo-state change (:hover/:active/:focus). Returns (layout_dirty_paragraphs, paint_dirty_paragraphs).
Source§

fn paragraphs(&self) -> Option<&ParagraphStore>

Borrowed compiled ParagraphStore shared with nativeview-runtime, SkiaBackend, and a11y.
Source§

fn paragraphs_mut(&mut self) -> Option<&mut ParagraphStore>

Mutable borrow of the compiled ParagraphStore (used to lock capacity before publish).
Source§

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) without mutating committed layout boxes, published rects, or viewport state.
Source§

fn layout_of(&self, id: NodeId) -> Option<LayoutRect>

Returns the absolute rounded layout rect of id from the latest pass, if live.
Source§

fn changed_rects(&self) -> Option<&[NodeId]>

Exact set of reachable live nodes whose committed 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 more
Source§

fn set_capture_box_edges(&mut self, enabled: bool)

Enables or disables opt-in resolved CSS box-edge capture (margin/border/padding/ content_size) for the Visual Layout Inspector. Disabled by default (0 B overhead).
Source§

fn capture_box_edges(&self) -> bool

Returns whether opt-in box-edge capture is currently active.
Source§

fn box_edges_of(&self, id: NodeId) -> Option<ResolvedBoxEdges>

Returns the exact resolved box edges of 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>)

Installs a custom text measurer and invalidates cached text measurements.
Source§

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, 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 reset(&mut self)

Clears all cached layout state.
Source§

fn set_media_env(&mut self, env: MediaEnv) -> bool

Sets the @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>), )

Visits 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

Bumped whenever responsive styles may resolve differently without a store commit (the media signature or a committed @container env changed). Caches of derived style (e.g. stacking plans) key on it. Engines without responsive support stay at 0.
Source§

fn is_show_on_hidden(&self, store: &NodeStore, id: NodeId) -> bool

Whether 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
where RawVecInner: Send, BoxRaw<Vec<OofCandidate>>: Send, Atomic<u16>: Send, Arc<dyn TextMeasurer>: Send, BoxRaw<SlotStorage<Arc<dyn LeafMeasureHook>>>: Send, Mutex<Vec<RefCell<(u64, Option<ResolvedResponsiveStyle>)>>>: Send,

§

impl Sync for TaffyStoreLayout
where RawVecInner: Sync, BoxRaw<Vec<OofCandidate>>: Sync, Atomic<u16>: Sync, Arc<dyn TextMeasurer>: Sync, BoxRaw<SlotStorage<Arc<dyn LeafMeasureHook>>>: Sync, Mutex<Vec<RefCell<(u64, Option<ResolvedResponsiveStyle>)>>>: Sync,

§

impl Unpin for TaffyStoreLayout
where *const u8 is !null: Unpin, Box<Vec<OofCandidate>>: Unpin, Align2<u16>: Unpin, Arc<dyn TextMeasurer>: Unpin, Box<SlotStorage<Arc<dyn LeafMeasureHook>>>: Unpin, Align4<u32>: Unpin, Align1<u8>: Unpin,

§

impl UnsafeUnpin for TaffyStoreLayout
where *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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<L> ResponsivePatches for L

Source§

fn visit_responsive_patches<'a>( &self, store: &'a NodeStore, id: NodeId, f: &mut dyn FnMut(ConditionalTier, RowPatchView<'a>), )

Source§

fn is_show_on_hidden(&self, store: &NodeStore, id: NodeId) -> bool

id’s show_on gate fails (display: none beating every rule, like Web’s !important).
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.