pub struct Class {
pub is_py_type: bool,
pub name: StringName,
pub concrete: bool,
pub args: Vec<FunctionArg>,
pub fields: HashSet<Field>,
pub parents: HashSet<TrueName>,
pub functions: HashSet<Function>,
}
Expand description
Concrete type.
Has fields and functions defined within and from parents for easy access.
Parents are immediate parents.
Vector of fields signifies the fields of self, followed by fields of consecutive parents and their parents. The same goes for functions.
Fields§
§is_py_type: bool
§name: StringName
§concrete: bool
§args: Vec<FunctionArg>
§fields: HashSet<Field>
§parents: HashSet<TrueName>
§functions: HashSet<Function>
Implementations§
Trait Implementations§
source§impl GetFun<Function> for Class
impl GetFun<Function> for Class
source§fn fun(
&self,
name: &StringName,
ctx: &Context,
pos: Position
) -> TypeResult<Function>
fn fun(
&self,
name: &StringName,
ctx: &Context,
pos: Position
) -> TypeResult<Function>
Get function of class.
If class does not implement function, traverse parents until function found.
source§impl HasParent<&Name> for Class
impl HasParent<&Name> for Class
source§fn has_parent(&self, name: &Name, ctx: &Context, pos: Position) -> TypeResult<bool>
fn has_parent(&self, name: &Name, ctx: &Context, pos: Position) -> TypeResult<bool>
Has name as parent. Read more
source§impl HasParent<&StringName> for Class
impl HasParent<&StringName> for Class
source§fn has_parent(
&self,
other: &StringName,
ctx: &Context,
pos: Position
) -> TypeResult<bool>
fn has_parent(
&self,
other: &StringName,
ctx: &Context,
pos: Position
) -> TypeResult<bool>
Has name as parent. Read more
source§impl HasParent<&TrueName> for Class
impl HasParent<&TrueName> for Class
source§fn has_parent(
&self,
name: &TrueName,
ctx: &Context,
pos: Position
) -> TypeResult<bool>
fn has_parent(
&self,
name: &TrueName,
ctx: &Context,
pos: Position
) -> TypeResult<bool>
Has name as parent. Read more
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.