pub struct DeclarationRuleList<'a, D, R, M>{
pub open_curly: LeftCurly,
pub declarations: Vec<'a, Declaration<'a, D, M>>,
pub at_rules: Vec<'a, R>,
pub close_curly: Option<RightCurly>,
/* private fields */
}Expand description
A generic struct for AST nodes representing a rule’s block that is only capable of having child declarations or at-rules. Qualified Rules are not allowed. This is defined as:
<declaration-rule-list>
│├─ "{" ─╮─╭─╮─ <declaration <D>> ─╮─╭─╮─ "}" ─╭─┤│
│ │ │ │ │ ╰───────╯
│ │ ╰─ <R> ───────────────┤ │
│ ╰───────────────────────╯ │
╰───────────────────────────╯<D> must implement the Declaration trait.
<R> should be an At-Rule. <R> is only parsed if an AtKeyword can be peeked.
It is an implementation of “declaration-rule-list”. It includes an error tolerance in that the ending }
token can be omitted, if at the end of the file.
Fields§
§open_curly: LeftCurly§declarations: Vec<'a, Declaration<'a, D, M>>§at_rules: Vec<'a, R>§close_curly: Option<RightCurly>Trait Implementations§
Source§impl<'a, D, R, M> Clone for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> Clone for DeclarationRuleList<'a, D, R, M>
Source§fn clone(&self) -> DeclarationRuleList<'a, D, R, M>
fn clone(&self) -> DeclarationRuleList<'a, D, R, M>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a, D, R, M> Debug for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> Debug for DeclarationRuleList<'a, D, R, M>
Source§impl<'a, D, R, M> Hash for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> Hash for DeclarationRuleList<'a, D, R, M>
Source§impl<'a, D, R, M> NodeWithMetadata<M> for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> NodeWithMetadata<M> for DeclarationRuleList<'a, D, R, M>
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, D, R, M> Ord for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> Ord for DeclarationRuleList<'a, D, R, M>
Source§fn cmp(&self, other: &DeclarationRuleList<'a, D, R, M>) -> Ordering
fn cmp(&self, other: &DeclarationRuleList<'a, D, R, M>) -> Ordering
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, D, R, M> Parse<'a> for DeclarationRuleList<'a, D, R, M>where
D: DeclarationValue<'a, M>,
R: NodeWithMetadata<M> + Parse<'a>,
M: NodeMetadata,
Declaration<'a, D, M>: Parse<'a>,
impl<'a, D, R, M> Parse<'a> for DeclarationRuleList<'a, D, R, M>where
D: DeclarationValue<'a, M>,
R: NodeWithMetadata<M> + Parse<'a>,
M: NodeMetadata,
Declaration<'a, D, M>: Parse<'a>,
Source§impl<'a, D, R, M> PartialEq for DeclarationRuleList<'a, D, R, M>where
D: DeclarationValue<'a, M> + PartialEq,
R: NodeWithMetadata<M> + PartialEq,
M: NodeMetadata + PartialEq,
impl<'a, D, R, M> PartialEq for DeclarationRuleList<'a, D, R, M>where
D: DeclarationValue<'a, M> + PartialEq,
R: NodeWithMetadata<M> + PartialEq,
M: NodeMetadata + PartialEq,
Source§fn eq(&self, other: &DeclarationRuleList<'a, D, R, M>) -> bool
fn eq(&self, other: &DeclarationRuleList<'a, D, R, M>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<'a, D, R, M> PartialOrd for DeclarationRuleList<'a, D, R, M>where
D: DeclarationValue<'a, M> + PartialOrd,
R: NodeWithMetadata<M> + PartialOrd,
M: NodeMetadata + PartialOrd,
impl<'a, D, R, M> PartialOrd for DeclarationRuleList<'a, D, R, M>where
D: DeclarationValue<'a, M> + PartialOrd,
R: NodeWithMetadata<M> + PartialOrd,
M: NodeMetadata + PartialOrd,
Source§impl<'a, D, R, M> Peek<'a> for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> Peek<'a> for DeclarationRuleList<'a, D, R, M>
Source§impl<'a, D, R, M> ToCursors for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> ToCursors for DeclarationRuleList<'a, D, R, M>
fn to_cursors(&self, s: &mut impl CursorSink)
Source§impl<'a, D, R, M> ToSpan for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> ToSpan for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> Eq for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> StructuralPartialEq for DeclarationRuleList<'a, D, R, M>
Auto Trait Implementations§
impl<'a, D, R, M> Freeze for DeclarationRuleList<'a, D, R, M>where
M: Freeze,
impl<'a, D, R, M> !RefUnwindSafe for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> !Send for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> !Sync for DeclarationRuleList<'a, D, R, M>
impl<'a, D, R, M> Unpin for DeclarationRuleList<'a, D, R, M>where
M: Unpin,
impl<'a, D, R, M> !UnwindSafe for DeclarationRuleList<'a, D, 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