pub trait AnyNodeData {
    fn fmt_indefinite(&self, fmt: &mut Formatter<'_>) -> Result;

    fn as_data(&self) -> &dyn AnyNodeData
    where
        Self: Sized
, { ... }
fn get_name(&self) -> Option<Spanned<Name>> { ... }
fn fmt_definite(&self, fmt: &mut Formatter<'_>) -> Result { ... }
fn format_indefinite(&self) -> FormatNodeIndefinite<'_>
    where
        Self: Sized
, { ... }
fn format_definite(&self) -> FormatNodeDefinite<'_>
    where
        Self: Sized
, { ... }
fn to_indefinite_string(&self) -> String
    where
        Self: Sized
, { ... }
fn to_definite_string(&self) -> String
    where
        Self: Sized
, { ... } }
Expand description

Common details of an AST node.

Required methods

Describe this node for diagnostics in indefinite form, e.g. “entity”.

This should not include any node name. Generally, we want to describe the kind of node to the user, for example as in “cannot use at this point in the code”.

Provided methods

Get this node’s name, or None if it does not have one.

Describe this node for diagnostics in definite form, e.g. “entity ‘top’”.

If the node has a name, this should include it. Generally, we want to provide enough information for the user to pinpoint an exact node in their design.

Describe this node for diagnostics in indefinite form, e.g. “entity”.

Describe this node for diagnostics in definite form, e.g. “entity ‘top’”.

Describe this node for diagnostics in indefinite form, e.g. “entity”.

Describe this node for diagnostics in definite form, e.g. “entity ‘top’”.

Implementors

Automatically implement AnyNodeData for Node<T> if the inner node implements it.