pub struct BuiltinTypeConstructor {
pub name: &'static str,
pub arity: usize,
pub kind: BuiltinTypeConstructorKind,
}Expand description
Definition of a built-in parameterized type constructor.
Built-in type constructors share a single surface form with user-defined
comptime-generic functions that return type (e.g. fn Vec(comptime T: type) -> type):
both are written Name(arg1, arg2, ...) in type position. The difference is
that built-in constructors are hard-wired in the compiler — sema resolves
the name against this registry and lowers directly to a TypeKind without
running the comptime interpreter.
See ADR-0061 (Ptr/MutPtr) and ADR-0062 (Ref/MutRef) for usage.
Fields§
§name: &'static strConstructor name as it appears in source code (e.g., “Ptr”).
arity: usizeNumber of comptime type arguments this constructor accepts.
kind: BuiltinTypeConstructorKindWhich built-in lowering to use.
Trait Implementations§
Source§impl Clone for BuiltinTypeConstructor
impl Clone for BuiltinTypeConstructor
Source§fn clone(&self) -> BuiltinTypeConstructor
fn clone(&self) -> BuiltinTypeConstructor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BuiltinTypeConstructor
impl Debug for BuiltinTypeConstructor
impl Copy for BuiltinTypeConstructor
Auto Trait Implementations§
impl Freeze for BuiltinTypeConstructor
impl RefUnwindSafe for BuiltinTypeConstructor
impl Send for BuiltinTypeConstructor
impl Sync for BuiltinTypeConstructor
impl Unpin for BuiltinTypeConstructor
impl UnsafeUnpin for BuiltinTypeConstructor
impl UnwindSafe for BuiltinTypeConstructor
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