Skip to main content

ModuleIdLt

Struct ModuleIdLt 

Source
pub struct ModuleIdLt<'db>(pub(crate) Id, pub(crate) PhantomData<fn() -> &'db ()>);

Tuple Fields§

§0: Id§1: PhantomData<fn() -> &'db ()>

Implementations§

Source§

impl ModuleIdLt<'static>

Source

pub fn ingredient(db: &dyn Database) -> &IngredientImpl<Self>

Source

pub(crate) fn ingredient_(zalsa: &Zalsa) -> &IngredientImpl<Self>

Source§

impl<'db> ModuleIdLt<'db>

Source

pub fn new<Db_>( db: &'db Db_, krate: Crate, block: Option<BlockIdLt<'db>>, containing_module_inside_def_map: Option<ModuleIdLt<'db>>, name_or_empty: Name, ) -> Self
where Db_: ?Sized + Database,

Source

pub fn krate<Db_>(self, db: &'db Db_) -> Crate
where Db_: ?Sized + Database,

The crate this module belongs to.

Source

pub fn block<Db_>(self, db: &'db Db_) -> Option<BlockIdLt<'db>>
where Db_: ?Sized + Database,

If this ModuleId was derived from a DefMap for a block expression, this stores the BlockId of that block expression. If None, this module is part of the crate-level DefMap of krate.

Source

pub fn containing_module_inside_def_map<Db_>( self, db: &'db Db_, ) -> &'db Option<ModuleIdLt<'db>>
where Db_: ?Sized + Database,

The parent module of this module, or None if this is the root module inside the def map (including for block def maps).

Source

pub(crate) fn name_or_empty<Db_>(self, db: &'db Db_) -> Name
where Db_: ?Sized + Database,

The name of this module, or [sym::__empty] for the root module.

Source§

impl<'_db> ModuleIdLt<'_db>

Source

pub fn default_debug_fmt(this: Self, f: &mut Formatter<'_>) -> Result
where for<'db> Crate: Debug, for<'db> Option<BlockIdLt<'db>>: Debug, for<'db> Option<ModuleIdLt<'db>>: Debug, for<'db> Name: Debug,

Default debug formatting for this struct (may be useful if you define your own Debug impl)

Source§

impl<'db> ModuleIdLt<'db>

Source

pub unsafe fn to_static(self) -> ModuleId

§Safety

The caller must ensure that the ModuleId is not leaked outside of query computations.

Source

pub fn def_map(self, db: &'db dyn SourceDatabase) -> &'db DefMap

Source

pub(crate) fn local_def_map( self, db: &'db dyn SourceDatabase, ) -> (&'db DefMap, &'db LocalDefMap)

Source

pub(crate) fn only_local_def_map( self, db: &'db dyn SourceDatabase, ) -> &'db LocalDefMap

Source

pub fn crate_def_map(self, db: &'db dyn SourceDatabase) -> &'db DefMap

Source

pub fn name(self, db: &dyn SourceDatabase) -> Option<Name>

Source

pub fn containing_module( self, db: &'db dyn SourceDatabase, ) -> Option<ModuleIdLt<'db>>

Returns the module containing self, either the parent mod, or the module (or block) containing the block, if self corresponds to a block expression.

Source

pub fn is_block_module(self, db: &dyn SourceDatabase) -> bool

Source§

impl ModuleIdLt<'static>

Source

pub unsafe fn to_db<'db>(self, _db: &'db dyn SourceDatabase) -> ModuleIdLt<'db>

§Safety

The caller must ensure that the ModuleId comes from the given database.

Trait Implementations§

Source§

impl AsId for ModuleIdLt<'_>

Source§

fn as_id(&self) -> Id

Source§

impl<'db> Clone for ModuleIdLt<'db>

Source§

fn clone(&self) -> ModuleIdLt<'db>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Configuration for ModuleIdLt<'static>

Source§

const LOCATION: Location

Source§

const DEBUG_NAME: &'static str = "ModuleIdLt"

The debug name of the tracked struct.
Source§

const TRACKED_FIELD_NAMES: &'static [&'static str]

The debug names of any tracked fields.
Source§

const TRACKED_FIELD_INDICES: &'static [usize]

The relative indices of any tracked fields.
Source§

const PERSIST: bool = false

Whether this struct should be persisted with the database.
Source§

type Fields<'db> = (Crate, Option<BlockIdLt<'db>>, Option<ModuleIdLt<'db>>, Name)

A (possibly empty) tuple of the fields for this struct.
Source§

type Revisions = [AtomicRevision; 0]

Source§

type Struct<'db> = ModuleIdLt<'db>

Source§

fn untracked_fields(fields: &Self::Fields<'_>) -> impl Hash

Source§

fn new_revisions(current_revision: Revision_) -> Self::Revisions

Create a new value revision array where each element is set to current_revision.
Source§

fn update_fields<'db>( current_revision: Revision_, revisions: &Self::Revisions, old_fields: &mut Self::Fields<'db>, new_fields: Self::Fields<'db>, ) -> bool

Update the field data and, if the value has changed, the appropriate entry in the revisions array (tracked fields only). Read more
Source§

fn serialize<S: Serializer>( fields: &Self::Fields<'_>, serializer: S, ) -> Result<S::Ok, S::Error>

Serialize the fields using serde. Read more
Source§

fn deserialize<'de, D: Deserializer<'de>>( deserializer: D, ) -> Result<Self::Fields<'static>, D::Error>

Deserialize the fields using serde. Read more
§

fn heap_size(_value: &Self::Fields<'_>) -> Option<usize>

Returns the size of any heap allocations in the output value, in bytes.
Source§

impl<'db> Copy for ModuleIdLt<'db>

Source§

impl Debug for ModuleIdLt<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'db> Eq for ModuleIdLt<'db>

Source§

impl From<ModuleIdLt<'static>> for ItemContainerId

Source§

fn from(it: ModuleId) -> ItemContainerId

Converts to this type from the input type.
Source§

impl From<ModuleIdLt<'static>> for ModuleDefId

Source§

fn from(it: ModuleId) -> ModuleDefId

Converts to this type from the input type.
Source§

impl From<ModuleIdLt<'static>> for AttrDefId

Source§

fn from(it: ModuleId) -> AttrDefId

Converts to this type from the input type.
Source§

impl<'db> FromId for ModuleIdLt<'db>

Source§

fn from_id(id: Id) -> Self

Source§

impl<'db> HasJar for ModuleIdLt<'db>

Source§

const KIND: JarKind = zalsa_::JarKind::Struct

The [JarKind] for Self::Jar.
Source§

type Jar = JarImpl<ModuleIdLt<'static>>

The [Jar] associated with this ingredient.
Source§

impl<'db> Hash for ModuleIdLt<'db>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Index<ModuleIdLt<'_>> for DefMap

Source§

type Output = ModuleData

The returned type after indexing.
Source§

fn index(&self, id: ModuleIdLt<'_>) -> &ModuleData

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<ModuleIdLt<'_>> for ModulesMap

Source§

type Output = ModuleData

The returned type after indexing.
Source§

fn index(&self, id: ModuleIdLt<'_>) -> &ModuleData

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<ModuleIdLt<'static>> for DefMap

Source§

fn index_mut(&mut self, id: ModuleId) -> &mut ModuleData

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<ModuleIdLt<'static>> for ModulesMap

Source§

fn index_mut(&mut self, id: ModuleId) -> &mut ModuleData

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'db> Ord for ModuleIdLt<'db>

Source§

fn cmp(&self, other: &ModuleIdLt<'db>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<'db> PartialEq for ModuleIdLt<'db>

Source§

fn eq(&self, other: &ModuleIdLt<'db>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'db> PartialOrd for ModuleIdLt<'db>

Source§

fn partial_cmp(&self, other: &ModuleIdLt<'db>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl SalsaStructInDb for ModuleIdLt<'_>

Source§

const LEAF_TYPE_IDS: &'static [ConstTypeId]

The type IDs of all concrete (leaf) salsa struct types that this type can contain. Read more
Source§

type MemoIngredientMap = MemoIngredientSingletonIndex

Source§

fn lookup_ingredient_index(aux: &Zalsa) -> IngredientIndices

Lookup or create ingredient indices. Read more
Source§

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>

Plumbing to support nested salsa supertypes. Read more
Source§

unsafe fn memo_table( zalsa: &Zalsa, id: Id, current_revision: Revision, ) -> MemoTableWithTypes<'_>

Return the memo table associated with id. Read more
Source§

impl SalsaValue for ModuleIdLt<'_>

Source§

impl Send for ModuleIdLt<'_>

Source§

impl<'db> StructuralPartialEq for ModuleIdLt<'db>

Source§

impl Sync for ModuleIdLt<'_>

Source§

impl TrackedStructInDb for ModuleIdLt<'_>

Source§

fn database_key_index(zalsa: &Zalsa, id: Id) -> DatabaseKeyIndex

Converts the identifier for this tracked struct into a DatabaseKeyIndex.

Auto Trait Implementations§

§

impl<'db> Freeze for ModuleIdLt<'db>

§

impl<'db> RefUnwindSafe for ModuleIdLt<'db>

§

impl<'db> Unpin for ModuleIdLt<'db>

§

impl<'db> UnsafeUnpin for ModuleIdLt<'db>

§

impl<'db> UnwindSafe for ModuleIdLt<'db>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> HashEqLike<&T> for T
where T: Hash + Eq,

§

fn eq(&self, data: &&T) -> bool

§

impl<T> HashEqLike<Cow<'_, T>> for T
where T: Hash + Eq + Clone,

§

fn eq(&self, data: &Cow<'_, T>) -> bool

§

impl<T> HashEqLike<T> for T
where T: Hash + Eq,

§

fn eq(&self, data: &T) -> bool

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoBox<dyn Any + Send + Sync> for T
where T: Any + Send + Sync,

§

fn into_box(self) -> Box<dyn Any + Send + Sync>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn Any + Send> for T
where T: Any + Send,

§

fn into_box(self) -> Box<dyn Any + Send>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn Any> for T
where T: Any,

§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Lookup<T> for T

§

fn into_owned(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more