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 ctx: ContextKind,
pub py_name: Option<Str>,
pub def_loc: AbsLocation,
pub alias_of: Option<AliasInfo>,
}
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>>
§ctx: ContextKind
§py_name: Option<Str>
§def_loc: AbsLocation
§alias_of: Option<AliasInfo>
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>>, ctx: ContextKind, py_name: Option<Str>, def_loc: AbsLocation ) -> Self
pub const fn maybe_alias( t: Type, muty: Mutability, vis: Visibility, kind: VarKind, comptime_decos: Option<Set<Str>>, ctx: ContextKind, py_name: Option<Str>, def_loc: AbsLocation, alias_of: Option<AliasInfo> ) -> 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, kind: ContextKind, namespace: Str, loc: AbsLocation ) -> Self
pub fn type_var(t: Type, def_loc: AbsLocation, namespace: Str) -> Self
pub fn record_field(t: Type, def_loc: AbsLocation, vis: Visibility) -> Self
pub fn is_ambiguously_typed_parameter(&self) -> bool
pub const fn is_parameter(&self) -> bool
pub fn impl_of(&self) -> Option<&Type>
pub fn def_namespace(&self) -> &Str
pub fn is_toplevel(&self) -> bool
pub fn is_fast_value(&self) -> bool
Trait Implementations§
source§impl HasType for VarInfo
impl HasType for VarInfo
fn ref_t(&self) -> &Type
fn ref_mut_t(&mut self) -> Option<&mut Type>
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 for VarInfo
impl PartialEq for VarInfo
impl Eq for VarInfo
impl StructuralPartialEq for VarInfo
Auto Trait Implementations§
impl Freeze for VarInfo
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