pub struct Semantics<'db> {
    pub db: &'db dyn HirDatabase,
    /* private fields */
}
Expand description

The primary API to get semantic information, like types, from syntax trees. Exposes the database it was created with through the db field.

Fields§

§db: &'db dyn HirDatabase

Implementations§

Constructs a new Semantics instance with the given database.

Returns the Concrete Syntax Tree for the file with the given file_id.

Computes the SemanticScope at the given position in a CST.

Returns the type of the given expression

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.