pub struct DeclarationList<'a, V, M>where
V: DeclarationValue<'a, M>,
M: NodeMetadata,{
pub open_curly: LeftCurly,
pub declarations: Vec<'a, Declaration<'a, V, M>>,
pub close_curly: Option<RightCurly>,
/* private fields */
}Expand description
A generic struct that can be used for AST nodes representing a rule’s block, that is only capable of having child declarations.
It is an implementation of “declaration-list”. It includes an error tolerance in that the ending } token can
be omitted, if at the end of the file.
The <V> must implement the DeclarationValue trait, as it is passed to Declaration.
<declaration-list>
│├─ "{" ─╮─╭─ <declaration> ──╮─╭─╮─ "}" ─╭─┤│
│ │ │ │ ╰───────╯
│ ╰──────────────────╯ │
╰──────────────────────╯Fields§
§open_curly: LeftCurly§declarations: Vec<'a, Declaration<'a, V, M>>§close_curly: Option<RightCurly>Trait Implementations§
Source§impl<'a, V, M> Clone for DeclarationList<'a, V, M>
impl<'a, V, M> Clone for DeclarationList<'a, V, M>
Source§fn clone(&self) -> DeclarationList<'a, V, M>
fn clone(&self) -> DeclarationList<'a, V, M>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a, V, M> Debug for DeclarationList<'a, V, M>
impl<'a, V, M> Debug for DeclarationList<'a, V, M>
Source§impl<'a, V, M> Hash for DeclarationList<'a, V, M>
impl<'a, V, M> Hash for DeclarationList<'a, V, M>
Source§impl<'a, V, M> NodeWithMetadata<M> for DeclarationList<'a, V, M>where
V: DeclarationValue<'a, M>,
M: NodeMetadata,
impl<'a, V, M> NodeWithMetadata<M> for DeclarationList<'a, V, M>where
V: DeclarationValue<'a, M>,
M: NodeMetadata,
Source§fn metadata(&self) -> M
fn metadata(&self) -> M
Returns the complete aggregated metadata for this node (self + children)
Source§fn self_metadata(&self, initial: M) -> M
fn self_metadata(&self, initial: M) -> M
Returns the metadata contributed by this node itself plus and child meta.
Most nodes don’t contribute metadata, so can simply return
child.
Other nodes may want to alter the metadata; supplying their own modifications
to initial.Source§impl<'a, V, M> Ord for DeclarationList<'a, V, M>
impl<'a, V, M> Ord for DeclarationList<'a, V, M>
Source§impl<'a, V, M> Parse<'a> for DeclarationList<'a, V, M>where
V: DeclarationValue<'a, M>,
M: NodeMetadata,
impl<'a, V, M> Parse<'a> for DeclarationList<'a, V, M>where
V: DeclarationValue<'a, M>,
M: NodeMetadata,
Source§impl<'a, V, M> PartialEq for DeclarationList<'a, V, M>
impl<'a, V, M> PartialEq for DeclarationList<'a, V, M>
Source§impl<'a, V, M> PartialOrd for DeclarationList<'a, V, M>
impl<'a, V, M> PartialOrd for DeclarationList<'a, V, M>
Source§impl<'a, V, M> Peek<'a> for DeclarationList<'a, V, M>where
V: DeclarationValue<'a, M>,
M: NodeMetadata,
impl<'a, V, M> Peek<'a> for DeclarationList<'a, V, M>where
V: DeclarationValue<'a, M>,
M: NodeMetadata,
Source§impl<'a, V, M> SemanticEq for DeclarationList<'a, V, M>where
V: DeclarationValue<'a, M>,
M: NodeMetadata,
impl<'a, V, M> SemanticEq for DeclarationList<'a, V, M>where
V: DeclarationValue<'a, M>,
M: NodeMetadata,
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, V, M> ToCursors for DeclarationList<'a, V, M>
impl<'a, V, M> ToCursors for DeclarationList<'a, V, M>
fn to_cursors(&self, s: &mut impl CursorSink)
Source§impl<'a, V, M> ToSpan for DeclarationList<'a, V, M>
impl<'a, V, M> ToSpan for DeclarationList<'a, V, M>
impl<'a, V, M> Eq for DeclarationList<'a, V, M>
impl<'a, V, M> StructuralPartialEq for DeclarationList<'a, V, M>where
V: DeclarationValue<'a, M>,
M: NodeMetadata,
Auto Trait Implementations§
impl<'a, V, M> Freeze for DeclarationList<'a, V, M>where
M: Freeze,
impl<'a, V, M> !RefUnwindSafe for DeclarationList<'a, V, M>
impl<'a, V, M> !Send for DeclarationList<'a, V, M>
impl<'a, V, M> !Sync for DeclarationList<'a, V, M>
impl<'a, V, M> Unpin for DeclarationList<'a, V, M>where
M: Unpin,
impl<'a, V, M> !UnwindSafe for DeclarationList<'a, V, M>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)