pub struct NamedTypeId<Id> {
pub layout: Id,
pub name: Option<Arc<str>>,
}Expand description
v0.3 WS-6 — the source-level type name carried alongside a
ConcreteType::Struct / ConcreteType::Enum.
A struct’s / enum’s type identity is its name, not its layout id (the
StructLayoutId / EnumLayoutId carriers are placeholders today — the
schema-aware layout registry is a tracked follow-up). The monomorphizer
uses this name for two load-bearing purposes:
- The specialization cache key (
ConcreteType::mono_key) — soid<T>(P{..})andid<T>(Q{..})produce distinct specializations. - The substituted parameter / return annotation
(
concrete_to_annotation) — so the specialized body type-checks against the real user type rather than a synthetic placeholder.
None is the legacy/placeholder spelling: a struct/enum ConcreteType
produced by a path that does not yet thread the name (e.g. the JIT-side
MIR-shape inference at helpers.rs). Name-aware producers (the
monomorphization call-site resolver) always populate it.
Fields§
§layout: IdLayout-registry id (placeholder 0 until the schema-aware layout
registry lands).
name: Option<Arc<str>>Source-level type name, when the producing site could thread it.
Implementations§
Source§impl<Id> NamedTypeId<Id>
impl<Id> NamedTypeId<Id>
Trait Implementations§
Source§impl<Id: Clone> Clone for NamedTypeId<Id>
impl<Id: Clone> Clone for NamedTypeId<Id>
Source§fn clone(&self) -> NamedTypeId<Id>
fn clone(&self) -> NamedTypeId<Id>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Id: Debug> Debug for NamedTypeId<Id>
impl<Id: Debug> Debug for NamedTypeId<Id>
Source§impl<'de, Id> Deserialize<'de> for NamedTypeId<Id>where
Id: Deserialize<'de>,
impl<'de, Id> Deserialize<'de> for NamedTypeId<Id>where
Id: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<Id: Hash> Hash for NamedTypeId<Id>
impl<Id: Hash> Hash for NamedTypeId<Id>
Source§impl<Id: PartialEq> PartialEq for NamedTypeId<Id>
impl<Id: PartialEq> PartialEq for NamedTypeId<Id>
Source§fn eq(&self, other: &NamedTypeId<Id>) -> bool
fn eq(&self, other: &NamedTypeId<Id>) -> bool
self and other values to be equal, and is used by ==.