6.5.5.2. Nodes (Entities)¶
In the following we describe the possible types of nodes contained in Rust RFGs.
Constant¶
Constant (inherits from:
Object)
Subtypes
none
Containing Views
Code Facts
Description
Represents Rust const variables.
Attributes
Attribute name |
Attribute type |
Inherited from |
|---|---|---|
Element.Has_Public_Visibility |
Toggle |
- |
Source.Column |
Integer |
Source_Entity |
Source.File |
String |
Source_Entity |
Source.Line |
Integer |
Source_Entity |
Source.Name |
String |
Source_Entity |
Source.Path |
String |
Source_Entity |
Crate¶
Crate (inherits from:
File_System_Entity)
Subtypes
none
Containing Views
Code Facts
Description
Represents Rust crates.
Attributes
Apart from common attributes and attributesinherited from base types,
Crate nodesdoes not have additional attributes.
Enum_Variant¶
Enum_Variant (inherits from:
Object)
Subtypes
none
Containing Views
Code Facts
Description
Represents an enum variant (unit, tuple, or struct variant).
Attributes
Attribute name |
Attribute type |
Inherited from |
|---|---|---|
Element.Has_Public_Visibility |
Toggle |
- |
Source.Column |
Integer |
Source_Entity |
Source.File |
String |
Source_Entity |
Source.Line |
Integer |
Source_Entity |
Source.Name |
String |
Source_Entity |
Source.Path |
String |
Source_Entity |
Impl¶
Impl (inherits from:
Type)
Subtypes
none
Containing Views
Code Facts
Description
Represents trait impls for certain types.
Attributes
Attribute name |
Attribute type |
Inherited from |
|---|---|---|
Element.Has_Interior_Mutability |
Toggle |
Type |
Element.Has_Public_Visibility |
Toggle |
Type |
Source.Column |
Integer |
Source_Entity |
Source.File |
String |
Source_Entity |
Source.Line |
Integer |
Source_Entity |
Source.Name |
String |
Source_Entity |
Source.Path |
String |
Source_Entity |
Member¶
Member (inherits from:
Object)
Subtypes
none
Containing Views
Code Facts
Description
Represents a named field of a struct or union.
Attributes
Attribute name |
Attribute type |
Inherited from |
|---|---|---|
Element.Has_Public_Visibility |
Toggle |
- |
Source.Column |
Integer |
Source_Entity |
Source.File |
String |
Source_Entity |
Source.Line |
Integer |
Source_Entity |
Source.Name |
String |
Source_Entity |
Source.Path |
String |
Source_Entity |
Method¶
Method (inherits from:
Routine)
Subtypes
none
Containing Views
Call, Code Facts, Entries
Description
Represents member routines with a self parameter.
Attributes
Attribute name |
Attribute type |
Inherited from |
|---|---|---|
Linkage.Rust_Calling_Convention |
String |
Routine |
Linkage.Rust_Export_Name |
String |
Routine |
Linkage.Rust_Import_Name |
String |
Routine |
Linkage.Rust_Is_Export |
Toggle |
Routine |
Linkage.Rust_Is_Import |
Toggle |
Routine |
Source.Column |
Integer |
Source_Entity |
Source.File |
String |
Source_Entity |
Source.Line |
Integer |
Source_Entity |
Source.Name |
String |
Source_Entity |
Source.Path |
String |
Source_Entity |
Namespace¶
Namespace (inherits from:
Source_Entity)
Subtypes
none
Containing Views
Code Facts
Description
Represents Rust modules.
Attributes
Attribute name |
Attribute type |
Inherited from |
|---|---|---|
Element.Has_Public_Visibility |
Toggle |
- |
Source.Column |
Integer |
Source_Entity |
Source.File |
String |
Source_Entity |
Source.Line |
Integer |
Source_Entity |
Source.Name |
String |
Source_Entity |
Source.Path |
String |
Source_Entity |
Routine¶
Routine (inherits from:
Source_Entity)
Subtypes
Method
Containing Views
Call, Code Facts, Entries
Description
Represents non-member routines.
Attributes
Attribute name |
Attribute type |
Inherited from |
|---|---|---|
Linkage.Rust_Calling_Convention |
String |
- |
Linkage.Rust_Export_Name |
String |
- |
Linkage.Rust_Import_Name |
String |
- |
Linkage.Rust_Is_Export |
Toggle |
- |
Linkage.Rust_Is_Import |
Toggle |
- |
Source.Column |
Integer |
Source_Entity |
Source.File |
String |
Source_Entity |
Source.Line |
Integer |
Source_Entity |
Source.Name |
String |
Source_Entity |
Source.Path |
String |
Source_Entity |
The following attributes are present on FFI functions:
Linkage.Rust_Calling_Convention: The calling convention of a function, e.g. for imported FFI functions, C in unsafe extern “C” { fn foo(); } or for exported functions, C in pub extern “C” fn foo() { /* … */ }.Linkage.Rust_Is_Import: Indicates whether the function is an imported FFI function, e.g. unsafe extern “C” { fn foo(); }.Linkage.Rust_Is_Export: Indicates whether the function is an exported FFI function, e.g. pub extern “C” fn foo() { /* … */ }.Linkage.Rust_Import_Name: The name of an imported FFI function in the foreign library being linked to, e.g. bar in unsafe extern “C” { #[link_name = “bar”] fn foo(); }.Linkage.Rust_Export_Name: The name of an exported FFI function in the foreign library being linked to, e.g. bar in #[unsafe(export_name = “bar”)] pub extern “C” fn foo() { /* … */ }.
Source_Entity¶
Source_Entity
Subtypes
Namespace,
Routine,
Type
Containing Views
none (only subtypes of
Source_Entity are contained in views)
Description
Base type for nodes.
Attributes
Attribute name |
Attribute type |
Inherited from |
|---|---|---|
Source.Column |
Integer |
- |
Source.File |
String |
- |
Source.Line |
Integer |
- |
Source.Name |
String |
- |
Source.Path |
String |
- |
Trait¶
Trait (inherits from:
Type)
Subtypes
none
Containing Views
Code Facts
Description
Represents Rust traits.
Attributes
Attribute name |
Attribute type |
Inherited from |
|---|---|---|
Element.Has_Public_Visibility |
Toggle |
- |
Element.Has_Interior_Mutability |
Toggle |
Type |
Element.Has_Public_Visibility |
Toggle |
Type |
Source.Column |
Integer |
Source_Entity |
Source.File |
String |
Source_Entity |
Source.Line |
Integer |
Source_Entity |
Source.Name |
String |
Source_Entity |
Source.Path |
String |
Source_Entity |
Type¶
Type (inherits from:
Source_Entity)
Subtypes
Impl,
Trait
Containing Views
Code Facts
Description
Represents Rusts algebraic data types and type aliases.
Attributes
Attribute name |
Attribute type |
Inherited from |
|---|---|---|
Element.Has_Interior_Mutability |
Toggle |
- |
Element.Has_Public_Visibility |
Toggle |
- |
Source.Column |
Integer |
Source_Entity |
Source.File |
String |
Source_Entity |
Source.Line |
Integer |
Source_Entity |
Source.Name |
String |
Source_Entity |
Source.Path |
String |
Source_Entity |
Variable¶
Variable (inherits from:
Object)
Subtypes
none
Containing Views
Code Facts
Description
Represents Rust static variables.
Attributes
Attribute name |
Attribute type |
Inherited from |
|---|---|---|
Element.Has_Public_Visibility |
Toggle |
- |
Element.Is_Mut |
Toggle |
- |
Element.Is_Static |
Toggle |
- |
Linkage.Rust_Export_Name |
String |
- |
Linkage.Rust_Import_Name |
String |
- |
Linkage.Rust_Is_Export |
Toggle |
- |
Linkage.Rust_Is_Import |
Toggle |
- |
Source.Column |
Integer |
Source_Entity |
Source.File |
String |
Source_Entity |
Source.Line |
Integer |
Source_Entity |
Source.Name |
String |
Source_Entity |
Source.Path |
String |
Source_Entity |
Element.Is_Mut is set when the variable is declared with the
mut keyword, e.g. static mut X: i32 = 0;.
The following attributes are present on FFI static variables:
Linkage.Rust_Is_Import: Indicates whether the variable is an imported FFI variable, e.g. unsafe extern “C” { static x: i32; }.Linkage.Rust_Is_Export: Indicates whether the variable is an exported FFI variable, e.g. #[unsafe(no_mangle)] pub static x: i32 = 0;.Linkage.Rust_Import_Name: The name of an imported FFI variable in the foreign library being linked to, e.g. bar in unsafe extern “C” { #[link_name = “bar”] static x: i32; }.Linkage.Rust_Export_Name: The name of an exported FFI variable in the foreign library being linked to, e.g. bar in #[unsafe(export_name = “bar”)] pub static x: i32 = 0;.