pub struct LayoutTree { /* private fields */ }Expand description
布局树。
包装 taffy 的 TaffyTree,并维护 DOM 节点指针地址(usize)
到 taffy NodeId 的映射。构建阶段由 build_layout_tree
填充;计算阶段由 compute_layout 读取。
§key 契约(PERF-12 降级)
node_map / LayoutResult 的 key 用 Rc::as_ptr as usize 裸地址(非不透明
句柄)。已知限制:DOM 树变更后地址可能失效/复用。后续批次应改为每个
元素一个稳定 id 的不透明句柄。
Implementations§
Source§impl LayoutTree
impl LayoutTree
Sourcepub fn new() -> Self
pub fn new() -> Self
创建空布局树(内部新建一份 FontSystem——每次调用支付一次
系统字体枚举;会话级复用请用 LayoutTree::new_with_fonts)。
Sourcepub fn new_with_fonts(fonts: &SharedFontSystem) -> Self
pub fn new_with_fonts(fonts: &SharedFontSystem) -> Self
创建空布局树,注入会话级共享字体系统(LAY-2)。
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for LayoutTree
impl !Send for LayoutTree
impl !Sync for LayoutTree
impl !UnwindSafe for LayoutTree
impl Forget for LayoutTree
impl Freeze for LayoutTree
impl Unpin for LayoutTree
impl UnsafeUnpin for LayoutTree
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