pub struct Block<'a, D, R, M>where
D: DeclarationValue<'a, M>,
M: NodeMetadata,{
pub open_curly: LeftCurly,
pub declarations: Vec<'a, Declaration<'a, D, M>>,
pub rules: Vec<'a, R>,
pub close_curly: Option<RightCurly>,
pub meta: M,
}Expand description
This trait provides an implementation for “consuming a blocks contents”.
<block>
│├─ "{" ─╭──╮─╭─ <ws-*> ─╮─╭─╮─╭─ ";" ─╮─╭─╮─ <R> ─╭─╮─ "}" ─┤│
│ │ ╰──────────╯ │ │ ╰───────╯ │ ├─ <D> ─┤ │
│ ╰──────────────╯ ╰───────────╯ ╰───────╯ │
╰───────────────────────────────────────────╯Fields§
§open_curly: LeftCurly§declarations: Vec<'a, Declaration<'a, D, M>>§rules: Vec<'a, R>§close_curly: Option<RightCurly>§meta: MTrait Implementations§
Source§impl<'a, D, R, M> NodeWithMetadata<M> for Block<'a, D, R, M>where
D: DeclarationValue<'a, M>,
M: NodeMetadata,
impl<'a, D, R, M> NodeWithMetadata<M> for Block<'a, D, R, M>where
D: DeclarationValue<'a, 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, D, R: Ord, M> Ord for Block<'a, D, R, M>
impl<'a, D, R: Ord, M> Ord for Block<'a, D, 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, D, R, M> Parse<'a> for Block<'a, D, R, M>where
D: DeclarationValue<'a, M>,
R: Parse<'a> + NodeWithMetadata<M> + RuleVariants<'a, DeclarationValue = D, Metadata = M>,
M: NodeMetadata,
impl<'a, D, R, M> Parse<'a> for Block<'a, D, R, M>where
D: DeclarationValue<'a, M>,
R: Parse<'a> + NodeWithMetadata<M> + RuleVariants<'a, DeclarationValue = D, Metadata = M>,
M: NodeMetadata,
Source§impl<'a, D, R: PartialOrd, M> PartialOrd for Block<'a, D, R, M>
impl<'a, D, R: PartialOrd, M> PartialOrd for Block<'a, D, R, M>
Source§impl<'a, D, R, M> Peek<'a> for Block<'a, D, R, M>where
D: DeclarationValue<'a, M>,
M: NodeMetadata,
impl<'a, D, R, M> Peek<'a> for Block<'a, D, R, M>where
D: DeclarationValue<'a, M>,
M: NodeMetadata,
Source§impl<'a, D, R, M> SemanticEq for Block<'a, D, R, M>
impl<'a, D, R, M> SemanticEq for Block<'a, D, 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, D, R, M> ToCursors for Block<'a, D, R, M>
impl<'a, D, R, M> ToCursors for Block<'a, D, R, M>
fn to_cursors(&self, s: &mut impl CursorSink)
impl<'a, D, R: Eq, M> Eq for Block<'a, D, R, M>
impl<'a, D, R, M> StructuralPartialEq for Block<'a, D, R, M>where
D: DeclarationValue<'a, M>,
M: NodeMetadata,
Auto Trait Implementations§
impl<'a, D, R, M> Freeze for Block<'a, D, R, M>where
M: Freeze,
impl<'a, D, R, M> !RefUnwindSafe for Block<'a, D, R, M>
impl<'a, D, R, M> !Send for Block<'a, D, R, M>
impl<'a, D, R, M> !Sync for Block<'a, D, R, M>
impl<'a, D, R, M> Unpin for Block<'a, D, R, M>where
M: Unpin,
impl<'a, D, R, M> !UnwindSafe for Block<'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