pub struct BoxTree { /* private fields */ }Expand description
The box tree — arena-allocated tree of layout boxes.
Implementations§
Source§impl BoxTree
impl BoxTree
pub fn new() -> Self
Sourcepub fn add_node(&mut self, kind: NodeKind, style: ComputedStyle) -> NodeId
pub fn add_node(&mut self, kind: NodeKind, style: ComputedStyle) -> NodeId
Add a new node to the tree. Returns the node’s ID.
Sourcepub fn append_child(&mut self, parent: NodeId, child: NodeId)
pub fn append_child(&mut self, parent: NodeId, child: NodeId)
Append a child to a parent node.
Sourcepub fn node(&self, id: NodeId) -> &BoxTreeNode
pub fn node(&self, id: NodeId) -> &BoxTreeNode
Get a reference to a node.
Sourcepub fn node_mut(&mut self, id: NodeId) -> &mut BoxTreeNode
pub fn node_mut(&mut self, id: NodeId) -> &mut BoxTreeNode
Get a mutable reference to a node.
Sourcepub fn style(&self, id: NodeId) -> &ComputedStyle
pub fn style(&self, id: NodeId) -> &ComputedStyle
Get the style of a node.
pub fn is_empty(&self) -> bool
Sourcepub fn formatting_context(&self, id: NodeId) -> FormattingContextType
pub fn formatting_context(&self, id: NodeId) -> FormattingContextType
Determine the formatting context for a node’s children.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BoxTree
impl RefUnwindSafe for BoxTree
impl Send for BoxTree
impl Sync for BoxTree
impl Unpin for BoxTree
impl UnwindSafe for BoxTree
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