pub struct RuleList<'a, R, M>where
R: NodeWithMetadata<M>,
M: NodeMetadata,{
pub open_curly: LeftCurly,
pub rules: Vec<'a, R>,
pub close_curly: Option<RightCurly>,
pub meta: M,
}Expand description
A struct representing an AST node block that only accepts child “Rules”. This is defined as:
<rule-list>
│├─ "{" ─╭─ <R> ─╮─╮─ "}" ─╭──┤│
╰───────╯ ╰───────╯This is an implementation of <at-rule-list> or <qualified-rule-list>.
It simply parses the open { and iterates collecing <R>s until the closing }.
Every item in the list must implement the Parse, ToCursors and ToSpan traits.
Fields§
§open_curly: LeftCurly§rules: Vec<'a, R>§close_curly: Option<RightCurly>§meta: MTrait Implementations§
Source§impl<'a, R, M> NodeWithMetadata<M> for RuleList<'a, R, M>where
R: NodeWithMetadata<M>,
M: NodeMetadata,
impl<'a, R, M> NodeWithMetadata<M> for RuleList<'a, R, M>where
R: NodeWithMetadata<M>,
M: NodeMetadata,
Source§fn metadata(&self) -> M
fn metadata(&self) -> M
Returns the complete aggregated metadata for this node (self + children).
Default implementation merges children’s metadata with self_metadata().
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, R, M> Ord for RuleList<'a, R, M>
impl<'a, R, M> Ord for RuleList<'a, R, M>
1.21.0 · 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
Source§impl<'a, R, M> PartialOrd for RuleList<'a, R, M>
impl<'a, R, M> PartialOrd for RuleList<'a, R, M>
Source§impl<'a, R, M> Peek<'a> for RuleList<'a, R, M>where
R: NodeWithMetadata<M>,
M: NodeMetadata,
impl<'a, R, M> Peek<'a> for RuleList<'a, R, M>where
R: NodeWithMetadata<M>,
M: NodeMetadata,
Source§impl<'a, R, M> SemanticEq for RuleList<'a, R, M>
impl<'a, R, M> SemanticEq for RuleList<'a, R, M>
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, R, M> ToCursors for RuleList<'a, R, M>
impl<'a, R, M> ToCursors for RuleList<'a, R, M>
fn to_cursors(&self, s: &mut impl CursorSink)
impl<'a, R, M> Eq for RuleList<'a, R, M>
impl<'a, R, M> StructuralPartialEq for RuleList<'a, R, M>where
R: NodeWithMetadata<M>,
M: NodeMetadata,
Auto Trait Implementations§
impl<'a, R, M> Freeze for RuleList<'a, R, M>where
M: Freeze,
impl<'a, R, M> !RefUnwindSafe for RuleList<'a, R, M>
impl<'a, R, M> !Send for RuleList<'a, R, M>
impl<'a, R, M> !Sync for RuleList<'a, R, M>
impl<'a, R, M> Unpin for RuleList<'a, R, M>where
M: Unpin,
impl<'a, R, M> UnsafeUnpin for RuleList<'a, R, M>where
M: UnsafeUnpin,
impl<'a, R, M> !UnwindSafe for RuleList<'a, R, M>
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