pub struct Box<'a, T, A = &'a Arena>where
A: Allocator,{ /* private fields */ }Expand description
An arena-allocated box that retains a reference to its allocator, enabling Clone support.
This type is intended for recursive AST nodes (e.g. color-mix() containing nested <color> values) where
indirection is required to break the cycle, but the allocation should still live in the parsing arena.
Implementations§
Trait Implementations§
impl<'a, T, A> Eq for Box<'a, T, A>
Source§impl<'a, M: NodeMetadata, T: NodeWithMetadata<M>, A: Allocator> NodeWithMetadata<M> for Box<'a, T, A>
impl<'a, M: NodeMetadata, T: NodeWithMetadata<M>, A: Allocator> NodeWithMetadata<M> for Box<'a, T, A>
Source§fn self_metadata(&self) -> M
fn self_metadata(&self) -> M
Returns the metadata contributed by this node itself, not including children.
Most nodes don’t contribute metadata, so can simply return
M::default().
Nodes like StyleRule or AtRules should return their own node kind flags here.Source§impl<'a, T, A> Ord for Box<'a, T, A>
impl<'a, T, A> Ord for Box<'a, T, A>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<'a, T, A> PartialOrd for Box<'a, T, A>where
T: PartialOrd,
A: Allocator,
impl<'a, T, A> PartialOrd for Box<'a, T, A>where
T: PartialOrd,
A: Allocator,
Source§impl<'a, T: SemanticEq, A: Allocator> SemanticEq for Box<'a, T, A>
impl<'a, T: SemanticEq, A: Allocator> SemanticEq for Box<'a, T, A>
Source§fn semantic_eq(&self, other: &Self) -> bool
fn semantic_eq(&self, other: &Self) -> bool
Returns
true if self and other are semantically equal.Source§impl<'a, T: ToCursors, A: Allocator> ToCursors for Box<'a, T, A>
impl<'a, T: ToCursors, A: Allocator> ToCursors for Box<'a, T, A>
fn to_cursors(&self, s: &mut impl CursorSink)
Auto Trait Implementations§
impl<'a, T, A = &'a Arena> !Send for Box<'a, T, A>
impl<'a, T, A = &'a Arena> !Sync for Box<'a, T, A>
impl<'a, T, A = &'a Arena> !UnwindSafe for Box<'a, T, A>
impl<'a, T, A> Freeze for Box<'a, T, A>
impl<'a, T, A> RefUnwindSafe for Box<'a, T, A>
impl<'a, T, A> Unpin for Box<'a, T, A>
impl<'a, T, A> UnsafeUnpin for Box<'a, T, A>
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