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§
source§impl Context
impl Context
sourcepub fn into_with_primitives(self) -> TypeResult<Self>
pub fn into_with_primitives(self) -> TypeResult<Self>
Loads pre-defined Python primitives into Context.
sourcepub fn into_with_std_lib(self) -> TypeResult<Self>
pub fn into_with_std_lib(self) -> TypeResult<Self>
Loads pre-defined Python standard library into Context.
Trait Implementations§
source§impl LookupClass<&Name, HashSet<Class, RandomState>> for Context
impl LookupClass<&Name, HashSet<Class, RandomState>> for Context
source§impl LookupClass<&StringName, Class> for Context
impl LookupClass<&StringName, Class> for Context
source§fn class(&self, class: &StringName, pos: Position) -> TypeResult<Class>
fn class(&self, class: &StringName, pos: Position) -> TypeResult<Class>
Look up union of GenericClass and substitute generics to yield set of classes.
Substitutes all generics in the class when found.
source§impl LookupFunction<&StringName, Function> for Context
impl LookupFunction<&StringName, Function> for Context
source§fn function(&self, function: &StringName, pos: Position) -> TypeResult<Function>
fn function(&self, function: &StringName, pos: Position) -> TypeResult<Function>
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.