pub enum ResolvableIdentifier {
Local(Identifier),
Global(Identifier),
Resolved(QualifiedIdentifier),
Unresolved(NamespacedIdentifier),
}Expand description
Represents an identifier which requires name resolution at some stage during lowering.
Variants§
Local(Identifier)
This identifier is resolved to a local binding (i.e. function parameter or let-bound var)
Global(Identifier)
This identifier is resolved to a global binding
Resolved(QualifiedIdentifier)
This identifier is resolved to a non-local item (i.e. module-level declaration or imported item)
Unresolved(NamespacedIdentifier)
This identifier is not yet resolved or is undefined in the current scope
Implementations§
Source§impl ResolvableIdentifier
impl ResolvableIdentifier
Sourcepub fn is_resolved(&self) -> bool
pub fn is_resolved(&self) -> bool
Returns true if this identifier has been resolved locally or otherwise
Sourcepub fn is_builtin(&self) -> bool
pub fn is_builtin(&self) -> bool
Returns true if this identifier refers to a known builtin function
Sourcepub fn module(&self) -> Option<ModuleId>
pub fn module(&self) -> Option<ModuleId>
The module to which this identifier is resolved
For locally-resolved identifiers, this returns None, same as
unresolved identifiers, check is_resolved to distinguish between
resolved/unresolved states
Sourcepub fn namespaced(&self) -> NamespacedIdentifier
pub fn namespaced(&self) -> NamespacedIdentifier
Obtains a NamespacedIdentifier from this identifier
Sourcepub fn resolved(&self) -> Option<QualifiedIdentifier>
pub fn resolved(&self) -> Option<QualifiedIdentifier>
Gets the QualifiedIdentifier if this identifier is of type Resolved
Trait Implementations§
Source§impl AsRef<Identifier> for ResolvableIdentifier
impl AsRef<Identifier> for ResolvableIdentifier
Source§fn as_ref(&self) -> &Identifier
fn as_ref(&self) -> &Identifier
Source§impl Clone for ResolvableIdentifier
impl Clone for ResolvableIdentifier
Source§fn clone(&self) -> ResolvableIdentifier
fn clone(&self) -> ResolvableIdentifier
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolvableIdentifier
impl Debug for ResolvableIdentifier
Source§impl Display for ResolvableIdentifier
impl Display for ResolvableIdentifier
Source§impl From<ResolvableIdentifier> for Identifier
impl From<ResolvableIdentifier> for Identifier
Source§fn from(id: ResolvableIdentifier) -> Self
fn from(id: ResolvableIdentifier) -> Self
Source§impl From<ResolvableIdentifier> for NamespacedIdentifier
impl From<ResolvableIdentifier> for NamespacedIdentifier
Source§fn from(id: ResolvableIdentifier) -> Self
fn from(id: ResolvableIdentifier) -> Self
Source§impl Hash for ResolvableIdentifier
impl Hash for ResolvableIdentifier
Source§impl PartialEq for ResolvableIdentifier
impl PartialEq for ResolvableIdentifier
Source§fn eq(&self, other: &ResolvableIdentifier) -> bool
fn eq(&self, other: &ResolvableIdentifier) -> bool
self and other values to be equal, and is used by ==.Source§impl Spanned for ResolvableIdentifier
impl Spanned for ResolvableIdentifier
fn span(&self) -> SourceSpan
impl Copy for ResolvableIdentifier
impl Eq for ResolvableIdentifier
impl StructuralPartialEq for ResolvableIdentifier
Auto Trait Implementations§
impl Freeze for ResolvableIdentifier
impl RefUnwindSafe for ResolvableIdentifier
impl Send for ResolvableIdentifier
impl Sync for ResolvableIdentifier
impl Unpin for ResolvableIdentifier
impl UnsafeUnpin for ResolvableIdentifier
impl UnwindSafe for ResolvableIdentifier
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
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more