Struct mamba::check::context::Context

source ·
pub struct Context {
    pub classes: HashSet<GenericClass>,
    pub functions: HashSet<GenericFunction>,
    pub fields: HashSet<GenericField>,
}
Expand description

A context stores all information of all identified types of the current application.

Functions and fields are also stored alongside identified classes such that we can also check usage of top-level fields and functions.

Fields§

§classes: HashSet<GenericClass>§functions: HashSet<GenericFunction>§fields: HashSet<GenericField>

Implementations§

Loads pre-defined Python primitives into Context.

Loads pre-defined Python standard library into Context.

Trait Implementations§

Formats the value using the given formatter. Read more

Create default Context with only Any type present.

Look up union of GenericClass and substitute generics to yield set of classes.

Substitutes all generics in the class when found.

Look up a field and substitutes generics to yield a Field.

Look up a function and substitutes generics to yield a Function.

If function does not exist, treat function as constructor and see if there exists a class with the same true_name.

The type returned in the event of a conversion error.
Performs the conversion.

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.