pub enum TypeKind {
Primitive(PrimitiveType),
Option(Box<TypeKind>),
Vec(Box<TypeKind>),
HashMap(Box<TypeKind>, Box<TypeKind>),
Tuple(Vec<TypeKind>),
Named(String),
Generic(String, Vec<TypeKind>),
Unit,
}Expand description
Every Rust type is mapped to one of these variants.
The IR is intentionally lossy — it captures only what is needed for type generation, not execution semantics.
Variants§
Primitive(PrimitiveType)
A Rust primitive type (String, u32, bool, f64, etc.)
Option(Box<TypeKind>)
Option<T> — becomes optional/nullable in target languages
Vec(Box<TypeKind>)
Vec<T> — becomes array/list in target languages
HashMap(Box<TypeKind>, Box<TypeKind>)
HashMap<K, V> — becomes dict/record/map in target languages
Tuple(Vec<TypeKind>)
Tuple types (A, B, C)
Named(String)
A custom struct/enum referenced by name
Generic(String, Vec<TypeKind>)
A generic type MyType<T, U>
Unit
The unit type ()
Trait Implementations§
impl StructuralPartialEq for TypeKind
Auto Trait Implementations§
impl Freeze for TypeKind
impl RefUnwindSafe for TypeKind
impl Send for TypeKind
impl Sync for TypeKind
impl Unpin for TypeKind
impl UnsafeUnpin for TypeKind
impl UnwindSafe for TypeKind
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