pub trait AnyNodeData {
// Required method
fn fmt_indefinite(&self, fmt: &mut Formatter<'_>) -> Result;
// Provided methods
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§
Sourcefn 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 AnyNodeDatawhere
Self: Sized,
Sourcefn get_name(&self) -> Option<Spanned<Name>>
fn get_name(&self) -> Option<Spanned<Name>>
Get this node’s name, or None if it does not have one.
Sourcefn 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.
Sourcefn 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”.
Sourcefn 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’”.
Sourcefn to_indefinite_string(&self) -> Stringwhere
Self: Sized,
fn to_indefinite_string(&self) -> Stringwhere
Self: Sized,
Describe this node for diagnostics in indefinite form, e.g. “entity”.
Sourcefn to_definite_string(&self) -> Stringwhere
Self: Sized,
fn to_definite_string(&self) -> Stringwhere
Self: Sized,
Describe this node for diagnostics in definite form, e.g. “entity ‘top’”.
Implementors§
impl AnyNodeData for ForeachIndexData
impl AnyNodeData for GenerateCaseData
impl AnyNodeData for ImportItemData
impl<'a> AnyNodeData for DataTypeData<'a>
impl<'a> AnyNodeData for DpiDeclData<'a>
impl<'a> AnyNodeData for ExprData<'a>
impl<'a> AnyNodeData for ItemData<'a>
impl<'a> AnyNodeData for ModportPortData<'a>
impl<'a> AnyNodeData for PackedDimData<'a>
impl<'a> AnyNodeData for PathSegmentData<'a>
impl<'a> AnyNodeData for PatternFieldData<'a>
impl<'a> AnyNodeData for PortConnData<'a>
impl<'a> AnyNodeData for PortData<'a>
impl<'a> AnyNodeData for TypeKindData<'a>
impl<'a> AnyNodeData for TypeOrExpr<'a>
impl<'a> AnyNodeData for UnpackedDimData<'a>
impl<'a> AnyNodeData for VarDimData<'a>
impl<'a> AnyNodeData for CallArgData<'a>
impl<'a> AnyNodeData for ClassDeclData<'a>
impl<'a> AnyNodeData for ContAssignData<'a>
impl<'a> AnyNodeData for EnumData<'a>
impl<'a> AnyNodeData for EnumNameData<'a>
impl<'a> AnyNodeData for GenerateBlockData<'a>
impl<'a> AnyNodeData for GenerateForData<'a>
impl<'a> AnyNodeData for GenerateIfData<'a>
impl<'a> AnyNodeData for GenvarDeclData<'a>
impl<'a> AnyNodeData for ImplicitDataTypeData<'a>
impl<'a> AnyNodeData for ImportDeclData<'a>
impl<'a> AnyNodeData for InstData<'a>
impl<'a> AnyNodeData for InstNameData<'a>
impl<'a> AnyNodeData for InterfaceData<'a>
impl<'a> AnyNodeData for ModportData<'a>
impl<'a> AnyNodeData for ModportNameData<'a>
impl<'a> AnyNodeData for ModportSimplePortData<'a>
impl<'a> AnyNodeData for ModuleData<'a>
impl<'a> AnyNodeData for NetDeclData<'a>
impl<'a> AnyNodeData for PackageData<'a>
impl<'a> AnyNodeData for ParamDeclData<'a>
impl<'a> AnyNodeData for ParamTypeDeclData<'a>
impl<'a> AnyNodeData for ParamValueDeclData<'a>
impl<'a> AnyNodeData for PortDeclData<'a>
impl<'a> AnyNodeData for ProcedureData<'a>
impl<'a> AnyNodeData for RootData<'a>
impl<'a> AnyNodeData for SourceFileData<'a>
impl<'a> AnyNodeData for StmtData<'a>
impl<'a> AnyNodeData for StructData<'a>
impl<'a> AnyNodeData for StructMemberData<'a>
impl<'a> AnyNodeData for SubroutineDeclData<'a>
impl<'a> AnyNodeData for SubroutinePortData<'a>
impl<'a> AnyNodeData for SubroutinePortDeclData<'a>
impl<'a> AnyNodeData for SubroutinePrototypeData<'a>
impl<'a> AnyNodeData for TypeData<'a>
impl<'a> AnyNodeData for TypedefData<'a>
impl<'a> AnyNodeData for VarDeclData<'a>
impl<'a> AnyNodeData for VarDeclNameData<'a>
impl<'a, T> AnyNodeData for Node<'a, T>where
T: AnyNodeData,
Automatically implement AnyNodeData for Node<T> if the inner node
implements it.