Trait moore_svlog::ast::AnyNodeData [−][src]
pub trait AnyNodeData {
fn fmt_indefinite(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>;
fn as_data(&self) -> &dyn AnyNodeData { ... }
fn get_name(&self) -> Option<Spanned<Name>> { ... }
fn fmt_definite(&self, fmt: &mut Formatter<'_>) -> Result<(), Error> { ... }
fn format_indefinite(&self) -> FormatNodeIndefinite<'_> { ... }
fn format_definite(&self) -> FormatNodeDefinite<'_> { ... }
fn to_indefinite_string(&self) -> String { ... }
fn to_definite_string(&self) -> String { ... }
}
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
Provided methods
fn as_data(&self) -> &dyn AnyNodeData
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.
fn format_indefinite(&self) -> FormatNodeIndefinite<'_>
fn format_indefinite(&self) -> FormatNodeIndefinite<'_>
Describe this node for diagnostics in indefinite form, e.g. “entity”.
fn format_definite(&self) -> FormatNodeDefinite<'_>
fn format_definite(&self) -> FormatNodeDefinite<'_>
Describe this node for diagnostics in definite form, e.g. “entity ‘top’”.
fn to_indefinite_string(&self) -> String
fn to_indefinite_string(&self) -> String
Describe this node for diagnostics in indefinite form, e.g. “entity”.
fn to_definite_string(&self) -> String
fn to_definite_string(&self) -> String
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.