#[repr(u32)]pub enum BuiltinTypeId {
Show 22 variants
Unit = 0,
Bool = 1,
Int = 2,
Byte = 3,
Char = 4,
Float = 5,
Text = 6,
Vec = 7,
Deque = 8,
Grid = 9,
Map = 10,
Set = 11,
Counter = 12,
MinHeap = 13,
MaxHeap = 14,
BitSet = 15,
Tuple = 16,
Record = 17,
Enum = 18,
Closure = 19,
VarCell = 20,
Range = 21,
}Expand description
The closed set of built-in runtime types (§11.4).
This enum is the type-id registry: a descriptor’s TypeId is derived
from its variant, so two built-ins cannot be labelled with the same id.
Uniqueness reduces to enum-discriminant uniqueness, which rustc already
enforces.
Variants§
Unit = 0
Bool = 1
Int = 2
Byte = 3
Char = 4
Float = 5
Text = 6
Vec = 7
Deque = 8
Grid = 9
Map = 10
Set = 11
Counter = 12
MinHeap = 13
MaxHeap = 14
BitSet = 15
Tuple = 16
Record = 17
Enum = 18
Closure = 19
VarCell = 20
Range = 21
Range (§4.11, ADR-059). New variants are appended, so no existing id
ever moves.
Implementations§
Source§impl BuiltinTypeId
impl BuiltinTypeId
Sourcepub const COUNT: usize = 22
pub const COUNT: usize = 22
Number of built-in types. Kept honest by BUILTINS’s array length and
by builtins_are_indexed_by_their_id.
Sourcepub const fn from_u32(v: u32) -> Option<BuiltinTypeId>
pub const fn from_u32(v: u32) -> Option<BuiltinTypeId>
Total inverse of the discriminant. A match rather than a transmute,
so an out-of-range word yields None instead of an invalid enum value.
Sourcepub fn descriptor(self) -> &'static TypeDescriptor
pub fn descriptor(self) -> &'static TypeDescriptor
This built-in’s descriptor. The inverse of
TypeDescriptor::as_builtin.
Trait Implementations§
Source§impl Clone for BuiltinTypeId
impl Clone for BuiltinTypeId
Source§fn clone(&self) -> BuiltinTypeId
fn clone(&self) -> BuiltinTypeId
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BuiltinTypeId
Source§impl Debug for BuiltinTypeId
impl Debug for BuiltinTypeId
impl Eq for BuiltinTypeId
Source§impl Hash for BuiltinTypeId
impl Hash for BuiltinTypeId
Source§impl Ord for BuiltinTypeId
impl Ord for BuiltinTypeId
Source§fn cmp(&self, other: &BuiltinTypeId) -> Ordering
fn cmp(&self, other: &BuiltinTypeId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for BuiltinTypeId
impl PartialEq for BuiltinTypeId
Source§impl PartialOrd for BuiltinTypeId
impl PartialOrd for BuiltinTypeId
impl StructuralPartialEq for BuiltinTypeId
Auto Trait Implementations§
impl Freeze for BuiltinTypeId
impl RefUnwindSafe for BuiltinTypeId
impl Send for BuiltinTypeId
impl Sync for BuiltinTypeId
impl Unpin for BuiltinTypeId
impl UnsafeUnpin for BuiltinTypeId
impl UnwindSafe for BuiltinTypeId
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