6.5.5.2. Nodes (Entities)

In the following we describe the possible types of nodes contained in Rust RFGs.

Constant

node-constant Constant (inherits from: node-object 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

node-crate Crate (inherits from: node-file-system-entity File_System_Entity)

Subtypes

none

Containing Views

Code Facts

Description

Represents Rust crates.

Attributes

Apart from common attributes and attributesinherited from base types, node-crate Crate nodesdoes not have additional attributes.

Enum_Variant

node-constant Enum_Variant (inherits from: node-object 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

node-impl Impl (inherits from: node-type 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

node-member Member (inherits from: node-object 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

node-method Method (inherits from: node-routine 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

node-namespace Namespace (inherits from: node-object 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

node-routine Routine (inherits from: node-object Source_Entity)

Subtypes

node-method 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

node-object Source_Entity

Subtypes

node-namespace Namespace, node-routine Routine, node-type Type

Containing Views

none (only subtypes of node-object 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

node-trait Trait (inherits from: node-type 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

node-type Type (inherits from: node-object Source_Entity)

Subtypes

node-impl Impl, node-trait 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

node-variable Variable (inherits from: node-object 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;.