pub enum EntityType {
PkgName(PackageKey, bool),
Const(Value),
TypeName,
Var(VarProperty),
Func(bool),
Label(bool),
Builtin(Builtin),
Nil,
}
Expand description
EntityType defines the types of LangObj entities
Variants§
PkgName(PackageKey, bool)
A PkgName represents an imported Go package.
Const(Value)
A Const represents a declared constant.
TypeName
A TypeName represents a name for a (defined or alias) type.
Var(VarProperty)
A Variable represents a declared variable (including function parameters and results, and struct fields).
Func(bool)
A Func represents a declared function, concrete method, or abstract (interface) method. Its Type() is always a *Signature. An abstract method may belong to many interfaces due to embedding.
Label(bool)
A Label represents a declared label. Labels don’t have a type.
Builtin(Builtin)
A Builtin represents a built-in function. Builtins don’t have a valid type.
Nil
Nil represents the predeclared value nil.
Implementations§
Source§impl EntityType
impl EntityType
pub fn is_pkg_name(&self) -> bool
pub fn is_const(&self) -> bool
pub fn is_type_name(&self) -> bool
pub fn is_var(&self) -> bool
pub fn is_func(&self) -> bool
pub fn is_label(&self) -> bool
pub fn is_builtin(&self) -> bool
pub fn is_nil(&self) -> bool
pub fn is_dependency(&self) -> bool
pub fn func_has_ptr_recv(&self) -> bool
pub fn func_set_has_ptr_recv(&mut self, has: bool)
pub fn var_property(&self) -> &VarProperty
pub fn var_property_mut(&mut self) -> &mut VarProperty
pub fn label_used(&self) -> bool
pub fn label_set_used(&mut self, used: bool)
Trait Implementations§
Source§impl Clone for EntityType
impl Clone for EntityType
Source§fn clone(&self) -> EntityType
fn clone(&self) -> EntityType
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for EntityType
impl Debug for EntityType
Source§impl PartialEq for EntityType
impl PartialEq for EntityType
impl StructuralPartialEq for EntityType
Auto Trait Implementations§
impl Freeze for EntityType
impl RefUnwindSafe for EntityType
impl Send for EntityType
impl Sync for EntityType
impl Unpin for EntityType
impl UnwindSafe for EntityType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more