Trait moore_svlog_syntax::ast::AnyNodeData [−][src]
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
fn fmt_indefinite(&self, fmt: &mut Formatter<'_>) -> Result
fn fmt_indefinite(&self, fmt: &mut Formatter<'_>) -> Result
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
Provided methods
fn as_data(&self) -> &dyn AnyNodeData where
Self: Sized,
Get this node’s name, or None if it does not have one.
fn fmt_definite(&self, fmt: &mut Formatter<'_>) -> Result
fn fmt_definite(&self, fmt: &mut Formatter<'_>) -> Result
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.
fn format_indefinite(&self) -> FormatNodeIndefinite<'_> where
Self: Sized,
fn format_indefinite(&self) -> FormatNodeIndefinite<'_> where
Self: Sized,
Describe this node for diagnostics in indefinite form, e.g. “entity”.
fn format_definite(&self) -> FormatNodeDefinite<'_> where
Self: Sized,
fn format_definite(&self) -> FormatNodeDefinite<'_> where
Self: Sized,
Describe this node for diagnostics in definite form, e.g. “entity ‘top’”.
fn to_indefinite_string(&self) -> String where
Self: Sized,
fn to_indefinite_string(&self) -> String where
Self: Sized,
Describe this node for diagnostics in indefinite form, e.g. “entity”.
fn to_definite_string(&self) -> String where
Self: Sized,
fn to_definite_string(&self) -> String where
Self: Sized,
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.