Enum go_types::EntityType
source · 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<EntityType> for EntityType
impl PartialEq<EntityType> for EntityType
source§fn eq(&self, other: &EntityType) -> bool
fn eq(&self, other: &EntityType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for EntityType
Auto Trait Implementations§
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