Struct erg_compiler::hir::Identifier
source · pub struct Identifier {
pub raw: Identifier,
pub qual_name: Option<Str>,
pub vi: VarInfo,
}
Fields§
§raw: Identifier
§qual_name: Option<Str>
§vi: VarInfo
Implementations§
source§impl Identifier
impl Identifier
pub const fn new(raw: Identifier, qual_name: Option<Str>, vi: VarInfo) -> Self
pub fn public(name: &'static str) -> Self
pub fn private(name: &'static str) -> Self
pub fn private_with_line(name: Str, line: u32) -> Self
pub fn public_with_line(dot: Token, name: Str, line: u32) -> Self
pub const fn bare(ident: Identifier) -> Self
pub fn is_py_api(&self) -> bool
pub fn is_const(&self) -> bool
pub fn vis(&self) -> &VisibilityModifier
pub const fn inspect(&self) -> &Str
sourcepub fn to_string_notype(&self) -> String
pub fn to_string_notype(&self) -> String
show dot + name (no qual_name & type)
pub fn is_procedural(&self) -> bool
pub fn downcast(self) -> Identifier
Trait Implementations§
source§impl Clone for Identifier
impl Clone for Identifier
source§fn clone(&self) -> Identifier
fn clone(&self) -> Identifier
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 Identifier
impl Debug for Identifier
source§impl Display for Identifier
impl Display for Identifier
source§impl From<&Identifier> for Field
impl From<&Identifier> for Field
source§fn from(ident: &Identifier) -> Self
fn from(ident: &Identifier) -> Self
Converts to this type from the input type.
source§impl HasType for Identifier
impl HasType for Identifier
fn ref_t(&self) -> &Type
fn ref_mut_t(&mut self) -> &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 Hash for Identifier
impl Hash for Identifier
source§impl Locational for Identifier
impl Locational for Identifier
source§fn loc(&self) -> Location
fn loc(&self) -> Location
NOTE:
loc
cannot be treated as a light method when self
is a large grammatical element.
If possible, delay the computation by passing &impl Locational
or other means.fn ln_begin(&self) -> Option<u32>
fn ln_end(&self) -> Option<u32>
fn col_begin(&self) -> Option<u32>
fn col_end(&self) -> Option<u32>
source§impl NestedDisplay for Identifier
impl NestedDisplay for Identifier
source§impl NoTypeDisplay for Identifier
impl NoTypeDisplay for Identifier
fn to_string_notype(&self) -> String
source§impl PartialEq<Identifier> for Identifier
impl PartialEq<Identifier> for Identifier
source§fn eq(&self, other: &Identifier) -> bool
fn eq(&self, other: &Identifier) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.