pub enum GeneralConstId<'db> {
ConstId(ConstId),
StaticId(StaticId),
AnonConstId(AnonConstId<'db>),
}Expand description
A constant, which might appears as a const item, an anonymous const block in expressions or patterns, or as a constant in types with const generics.
Variants§
Implementations§
Source§impl<'db> GeneralConstId<'db>
impl<'db> GeneralConstId<'db>
pub fn generic_def(self, db: &'db dyn HirDatabase) -> Option<GenericDefId>
pub fn name(self, db: &'db dyn SourceDatabase) -> String
Trait Implementations§
Source§impl<'db> Clone for GeneralConstId<'db>
impl<'db> Clone for GeneralConstId<'db>
Source§fn clone(&self) -> GeneralConstId<'db>
fn clone(&self) -> GeneralConstId<'db>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'db> Debug for GeneralConstId<'db>
impl<'db> Debug for GeneralConstId<'db>
Source§impl<'db> From<AnonConstId<'db>> for GeneralConstId<'db>
impl<'db> From<AnonConstId<'db>> for GeneralConstId<'db>
Source§fn from(it: AnonConstId<'db>) -> GeneralConstId<'db>
fn from(it: AnonConstId<'db>) -> GeneralConstId<'db>
Converts to this type from the input type.
Source§impl<'db> From<ConstId> for GeneralConstId<'db>
impl<'db> From<ConstId> for GeneralConstId<'db>
Source§fn from(it: ConstId) -> GeneralConstId<'db>
fn from(it: ConstId) -> GeneralConstId<'db>
Converts to this type from the input type.
Source§impl<'db> From<GeneralConstId<'db>> for GeneralConstIdWrapper<'db>
impl<'db> From<GeneralConstId<'db>> for GeneralConstIdWrapper<'db>
Source§fn from(value: GeneralConstId<'db>) -> GeneralConstIdWrapper<'db>
fn from(value: GeneralConstId<'db>) -> GeneralConstIdWrapper<'db>
Converts to this type from the input type.
Source§impl<'db> From<GeneralConstId<'db>> for SolverDefId<'db>
impl<'db> From<GeneralConstId<'db>> for SolverDefId<'db>
Source§fn from(value: GeneralConstId<'db>) -> Self
fn from(value: GeneralConstId<'db>) -> Self
Converts to this type from the input type.
Source§impl<'db> From<GeneralConstIdWrapper<'db>> for GeneralConstId<'db>
impl<'db> From<GeneralConstIdWrapper<'db>> for GeneralConstId<'db>
Source§fn from(value: GeneralConstIdWrapper<'db>) -> GeneralConstId<'db>
fn from(value: GeneralConstIdWrapper<'db>) -> GeneralConstId<'db>
Converts to this type from the input type.
Source§impl<'db> From<StaticId> for GeneralConstId<'db>
impl<'db> From<StaticId> for GeneralConstId<'db>
Source§fn from(it: StaticId) -> GeneralConstId<'db>
fn from(it: StaticId) -> GeneralConstId<'db>
Converts to this type from the input type.
Source§impl<'db> FromIdWithDb for GeneralConstId<'db>
impl<'db> FromIdWithDb for GeneralConstId<'db>
Source§impl<'db> Hash for GeneralConstId<'db>
impl<'db> Hash for GeneralConstId<'db>
Source§impl<'db> PartialEq for GeneralConstId<'db>
impl<'db> PartialEq for GeneralConstId<'db>
Source§fn eq(&self, other: &GeneralConstId<'db>) -> bool
fn eq(&self, other: &GeneralConstId<'db>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<'db> SalsaStructInDb for GeneralConstId<'db>
impl<'db> SalsaStructInDb for GeneralConstId<'db>
Source§const LEAF_TYPE_IDS: &'static [ConstTypeId]
const LEAF_TYPE_IDS: &'static [ConstTypeId]
The type IDs of all concrete (leaf) salsa struct types that this type can contain. Read more
type MemoIngredientMap = MemoIngredientIndices
Source§fn lookup_ingredient_index(__zalsa: &Zalsa) -> IngredientIndices
fn lookup_ingredient_index(__zalsa: &Zalsa) -> IngredientIndices
Lookup or create ingredient indices. Read more
Source§fn entries(zalsa: &Zalsa) -> impl Iterator<Item = DatabaseKeyIndex> + '_
fn entries(zalsa: &Zalsa) -> impl Iterator<Item = DatabaseKeyIndex> + '_
Returns the IDs of any instances of this struct in the database.
Source§fn cast(id: Id, type_id: TypeId) -> Option<Self>
fn cast(id: Id, type_id: TypeId) -> Option<Self>
Plumbing to support nested salsa supertypes. Read more
Source§unsafe fn memo_table(
zalsa: &Zalsa,
id: Id,
current_revision: Revision,
) -> MemoTableWithTypes<'_>
unsafe fn memo_table( zalsa: &Zalsa, id: Id, current_revision: Revision, ) -> MemoTableWithTypes<'_>
Return the memo table associated with
id. Read moreimpl<'db> Copy for GeneralConstId<'db>
impl<'db> Eq for GeneralConstId<'db>
impl<'db> StructuralPartialEq for GeneralConstId<'db>
Auto Trait Implementations§
impl<'db> Freeze for GeneralConstId<'db>
impl<'db> RefUnwindSafe for GeneralConstId<'db>
impl<'db> Send for GeneralConstId<'db>
impl<'db> Sync for GeneralConstId<'db>
impl<'db> Unpin for GeneralConstId<'db>
impl<'db> UnsafeUnpin for GeneralConstId<'db>
impl<'db> UnwindSafe for GeneralConstId<'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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§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
Compare self to
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
Checks if this value is equivalent to the given key. Read more
§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
Checks if this value is equivalent to the given key. Read more
§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> for T
§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> ⓘ
Converts
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> ⓘ
Converts
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