pub enum NameResolutionSym<'db> {
SymModule(SymModule<'db>),
SymAggregate(SymAggregate<'db>),
SymFunction(SymFunction<'db>),
SymPrimitive(SymPrimitive<'db>),
SymVariable(SymVariable<'db>),
}Expand description
Result of name resolution.
Variants§
SymModule(SymModule<'db>)
SymAggregate(SymAggregate<'db>)
SymFunction(SymFunction<'db>)
SymPrimitive(SymPrimitive<'db>)
SymVariable(SymVariable<'db>)
Implementations§
Source§impl<'db> NameResolutionSym<'db>
impl<'db> NameResolutionSym<'db>
Sourcepub fn categorize(self, db: &'db dyn Db) -> impl Display + 'db
pub fn categorize(self, db: &'db dyn Db) -> impl Display + 'db
Returns a string describing self that fits the mold “an X”.
Sourcepub(crate) fn resolve_relative_id(
self,
db: &'db dyn Db,
id: SpannedIdentifier<'db>,
) -> Errors<Result<NameResolutionSym<'db>, NameResolutionSym<'db>>>
pub(crate) fn resolve_relative_id( self, db: &'db dyn Db, id: SpannedIdentifier<'db>, ) -> Errors<Result<NameResolutionSym<'db>, NameResolutionSym<'db>>>
Attempt to resolve a single identifier;
only works if self is a module or other “lexically resolved” name resolution.
Returns Ok(Ok(r)) if resolution succeeded.
Returns Ok(Err(self)) if resolution failed because this is not a lexically resolved result.
Type checking will have to handle it.
Returns error only if this was a lexically resolved name resolution and the identifier is not found.
FIXME: Remove all error reporting from here and push it further up the chain, since the context of the lookup may matter to how we report the error.
Sourcepub fn describe(self, db: &'db dyn Db) -> impl Display + 'db
pub fn describe(self, db: &'db dyn Db) -> impl Display + 'db
Returns a string describing self that fits the mold “an X named foo”.
fn expected_generic_parameters(&self, db: &'db dyn Db) -> usize
fn span(&self, db: &'db dyn Db) -> Option<Span<'db>>
Sourcepub fn style(self, db: &'db dyn Db) -> Option<SymAggregateStyle>
pub fn style(self, db: &'db dyn Db) -> Option<SymAggregateStyle>
If this symbol references an aggregate (class, struct, etc) returns the
aggregate style. Else returns None.
Trait Implementations§
Source§impl<'db> Clone for NameResolutionSym<'db>
impl<'db> Clone for NameResolutionSym<'db>
Source§fn clone(&self) -> NameResolutionSym<'db>
fn clone(&self) -> NameResolutionSym<'db>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'db> Debug for NameResolutionSym<'db>
impl<'db> Debug for NameResolutionSym<'db>
Source§impl<'db> From<SymAggregate<'db>> for NameResolutionSym<'db>
impl<'db> From<SymAggregate<'db>> for NameResolutionSym<'db>
Source§fn from(value: SymAggregate<'db>) -> Self
fn from(value: SymAggregate<'db>) -> Self
Source§impl<'db> From<SymFunction<'db>> for NameResolutionSym<'db>
impl<'db> From<SymFunction<'db>> for NameResolutionSym<'db>
Source§fn from(value: SymFunction<'db>) -> Self
fn from(value: SymFunction<'db>) -> Self
Source§impl<'db> From<SymModule<'db>> for NameResolutionSym<'db>
impl<'db> From<SymModule<'db>> for NameResolutionSym<'db>
Source§impl<'db> From<SymPrimitive<'db>> for NameResolutionSym<'db>
impl<'db> From<SymPrimitive<'db>> for NameResolutionSym<'db>
Source§fn from(value: SymPrimitive<'db>) -> Self
fn from(value: SymPrimitive<'db>) -> Self
Source§impl<'db> From<SymVariable<'db>> for NameResolutionSym<'db>
impl<'db> From<SymVariable<'db>> for NameResolutionSym<'db>
Source§fn from(value: SymVariable<'db>) -> Self
fn from(value: SymVariable<'db>) -> Self
Source§impl<'db> PartialEq for NameResolutionSym<'db>
impl<'db> PartialEq for NameResolutionSym<'db>
Source§impl<'db> Serialize for NameResolutionSym<'db>
impl<'db> Serialize for NameResolutionSym<'db>
Source§impl<'db> Update for NameResolutionSym<'db>
impl<'db> Update for NameResolutionSym<'db>
impl<'db> Copy for NameResolutionSym<'db>
impl<'db> Eq for NameResolutionSym<'db>
impl<'db> StructuralPartialEq for NameResolutionSym<'db>
Auto Trait Implementations§
impl<'db> Freeze for NameResolutionSym<'db>
impl<'db> !RefUnwindSafe for NameResolutionSym<'db>
impl<'db> Send for NameResolutionSym<'db>
impl<'db> Sync for NameResolutionSym<'db>
impl<'db> Unpin for NameResolutionSym<'db>
impl<'db> UnsafeUnpin for NameResolutionSym<'db>
impl<'db> !UnwindSafe for NameResolutionSym<'db>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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