Enum ra_ap_ide_db::defs::NameClass[][src]

pub enum NameClass {
    Definition(Definition),
    ConstReference(Definition),
    PatFieldShorthand {
        local_def: Local,
        field_ref: Field,
    },
}
Expand description

On a first blush, a single ast::Name defines a single definition at some scope. That is, that, by just looking at the syntactical category, we can unambiguously define the semantic category.

Sadly, that’s not 100% true, there are special cases. To make sure that callers handle all the special cases correctly via exhaustive matching, we add a NameClass enum which lists all of them!

A model special case is None constant in pattern.

Variants

Definition(Definition)

Tuple Fields of Definition

0: Definition
ConstReference(Definition)

None in if let None = Some(82) {}. Syntactically, it is a name, but semantically it is a reference.

Tuple Fields of ConstReference

0: Definition
PatFieldShorthand

field in if let Foo { field } = foo. Here, ast::Name both introduces a definition into a local scope, and refers to an existing definition.

Fields of PatFieldShorthand

local_def: Localfield_ref: Field

Implementations

Definition defined by this name.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Cast a value to type U using CastTo.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more