pub struct TypeId(pub usize);
Expand description
A unique identifier for a type in the type system
Tuple Fields§
§0: usize
Implementations§
Source§impl TypeId
impl TypeId
Sourcepub fn from_primitive(primitive: PrimitiveType) -> Self
pub fn from_primitive(primitive: PrimitiveType) -> Self
Creates a TypeId for a primitive type - PREFERRED METHOD
This ensures consistent TypeId assignment for primitive types and is more robust than direct casting.
§Arguments
primitive
- The primitive type to create a TypeId for
§Returns
A TypeId that is guaranteed to be unique and consistent for the primitive type
Sourcepub fn unspecified_int() -> Self
pub fn unspecified_int() -> Self
Returns the TypeId for unspecified integer type
Sourcepub fn unspecified_float() -> Self
pub fn unspecified_float() -> Self
Returns the TypeId for unspecified float type
Trait Implementations§
Source§impl From<PrimitiveType> for TypeId
impl From<PrimitiveType> for TypeId
Source§fn from(primitive: PrimitiveType) -> Self
fn from(primitive: PrimitiveType) -> Self
Converts to this type from the input type.
impl Copy for TypeId
impl Eq for TypeId
impl StructuralPartialEq for TypeId
Auto Trait Implementations§
impl Freeze for TypeId
impl RefUnwindSafe for TypeId
impl Send for TypeId
impl Sync for TypeId
impl Unpin for TypeId
impl UnwindSafe for TypeId
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