Skip to main content

NamedTypeId

Struct NamedTypeId 

Source
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:

  1. The specialization cache key (ConcreteType::mono_key) — so id<T>(P{..}) and id<T>(Q{..}) produce distinct specializations.
  2. 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: Id

Layout-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>

Source

pub fn named(layout: Id, name: impl Into<Arc<str>>) -> Self

A named type id — the name is the load-bearing identity.

Source

pub fn placeholder(layout: Id) -> Self

A placeholder type id — no name threaded (legacy producers).

Source

pub fn name_str(&self) -> Option<&str>

The source-level name, if threaded.

Trait Implementations§

Source§

impl<Id: Clone> Clone for NamedTypeId<Id>

Source§

fn clone(&self) -> NamedTypeId<Id>

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<Id: Debug> Debug for NamedTypeId<Id>

Source§

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

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

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>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Id: Hash> Hash for NamedTypeId<Id>

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<Id: PartialEq> PartialEq for NamedTypeId<Id>

Source§

fn eq(&self, other: &NamedTypeId<Id>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Id> Serialize for NamedTypeId<Id>
where Id: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<Id: Eq> Eq for NamedTypeId<Id>

Source§

impl<Id> StructuralPartialEq for NamedTypeId<Id>

Auto Trait Implementations§

§

impl<Id> Freeze for NamedTypeId<Id>
where Id: Freeze,

§

impl<Id> RefUnwindSafe for NamedTypeId<Id>
where Id: RefUnwindSafe,

§

impl<Id> Send for NamedTypeId<Id>
where Id: Send,

§

impl<Id> Sync for NamedTypeId<Id>
where Id: Sync,

§

impl<Id> Unpin for NamedTypeId<Id>
where Id: Unpin,

§

impl<Id> UnsafeUnpin for NamedTypeId<Id>
where Id: UnsafeUnpin,

§

impl<Id> UnwindSafe for NamedTypeId<Id>
where Id: UnwindSafe,

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

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

Source§

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.

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.

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

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,