Struct erg_compiler::varinfo::VarInfo
source · pub struct VarInfo {
pub t: Type,
pub muty: Mutability,
pub vis: Visibility,
pub kind: VarKind,
pub comptime_decos: Option<Set<Str>>,
pub impl_of: Option<Type>,
pub py_name: Option<Str>,
pub def_loc: AbsLocation,
}
Expand description
Has information about the type, variability, visibility, and where the variable was defined (or declared, generated)
Fields§
§t: Type
§muty: Mutability
§vis: Visibility
§kind: VarKind
§comptime_decos: Option<Set<Str>>
§impl_of: Option<Type>
§py_name: Option<Str>
§def_loc: AbsLocation
Implementations§
source§impl VarInfo
impl VarInfo
pub const ILLEGAL: Self = _
pub const fn const_default_private() -> Self
pub const fn const_default_public() -> Self
pub const fn new( t: Type, muty: Mutability, vis: Visibility, kind: VarKind, comptime_decos: Option<Set<Str>>, impl_of: Option<Type>, py_name: Option<Str>, def_loc: AbsLocation ) -> Self
pub fn same_id_as(&self, id: DefId) -> bool
pub fn nd_parameter(t: Type, def_loc: AbsLocation, namespace: Str) -> Self
pub fn d_parameter(t: Type, def_loc: AbsLocation, namespace: Str) -> Self
pub fn instance_attr( field: Field, t: Type, impl_of: Option<Type>, namespace: Str ) -> Self
pub fn type_var(t: Type, def_loc: AbsLocation, namespace: Str) -> Self
pub fn is_untyped_parameter(&self) -> bool
Trait Implementations§
source§impl HasType for VarInfo
impl HasType for VarInfo
fn ref_t(&self) -> &Type
source§fn ref_mut_t(&mut self) -> &mut Type
fn ref_mut_t(&mut self) -> &mut Type
x.ref_mut_t()
may panic, in which case x
is Call
and x.ref_t() == Type::Failure
.fn signature_t(&self) -> Option<&Type>
fn signature_mut_t(&mut self) -> Option<&mut Type>
fn t(&self) -> Type
fn inner_ts(&self) -> Vec<Type>
fn lhs_t(&self) -> &Type
fn rhs_t(&self) -> &Type
source§impl PartialEq<VarInfo> for VarInfo
impl PartialEq<VarInfo> for VarInfo
impl Eq for VarInfo
impl StructuralEq for VarInfo
impl StructuralPartialEq for VarInfo
Auto Trait Implementations§
impl RefUnwindSafe for VarInfo
impl Send for VarInfo
impl Sync for VarInfo
impl Unpin for VarInfo
impl UnwindSafe for VarInfo
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