pub enum Type {
Show 24 variants
Int8,
Int16,
Int32,
Int64,
Float,
Double,
String,
Bool,
Pointer(Box<Type>),
Ref(Box<Type>),
Generic(Box<Type>, Vec<Type>),
GenericInstance {
template: Box<Type>,
instance: Box<Type>,
},
Alias(String),
Struct(Option<String>, Vec<(String, Type)>),
Enum(Option<String>, Vec<(String, Option<Type>)>),
Function(Box<Type>, Vec<(String, Type)>, bool),
Array(Box<Type>),
Map(Box<Type>, Box<Type>),
Closure {
name: Option<String>,
ptr: (Box<Type>, Vec<(String, Type)>),
env: Vec<(String, Type)>,
},
Any,
Unit,
ArrayVarArg(Box<Type>),
VarArg,
Module,
}
Variants§
Int8
Int16
Int32
Int64
Float
Double
String
Bool
Pointer(Box<Type>)
Ref(Box<Type>)
Generic(Box<Type>, Vec<Type>)
GenericInstance
Alias(String)
Struct(Option<String>, Vec<(String, Type)>)
Enum(Option<String>, Vec<(String, Option<Type>)>)
Function(Box<Type>, Vec<(String, Type)>, bool)
Array(Box<Type>)
Map(Box<Type>, Box<Type>)
Closure
Any
Unit
ArrayVarArg(Box<Type>)
VarArg
Module
Implementations§
Source§impl Type
impl Type
pub fn get_struct_name(&self) -> Option<&str>
pub fn get_composite_type_name(&self) -> Option<&str>
pub fn get_generic_wrapper(&self) -> Option<&Type>
pub fn unwrap_ref(&self) -> Type
pub fn has_name(&self) -> bool
pub fn set_name(&mut self, name: String)
pub fn is_generic_instance(&self) -> bool
pub fn set_composite_type_name(&mut self, name: Option<String>)
pub fn is_integer(&self) -> bool
pub fn get_enum_variant_type(&self, name: &str) -> Option<Type>
pub fn is_float(&self) -> bool
pub fn is_double(&self) -> bool
pub fn is_generic(&self) -> bool
pub fn id(&self) -> i32
pub fn is_primitive(&self) -> bool
pub fn as_struct(&self) -> Option<&Vec<(String, Type)>>
pub fn get_generic_template(&self) -> Option<&Type>
pub fn is_function(&self) -> bool
pub fn is_module(&self) -> bool
pub fn is_pointer(&self) -> bool
pub fn is_array_vararg(&self) -> bool
pub fn with_return_type(&self, return_type: Type) -> Type
pub fn is_ref(&self) -> bool
pub fn get_struct_field(&self, name: impl AsRef<str>) -> Option<(usize, Type)>
pub fn get_function_arg_count(&self) -> usize
pub fn get_closure_fn_name(&self) -> Option<String>
pub fn get_function_arg_type(&self, index: usize) -> Option<Type>
pub fn is_i8(&self) -> bool
pub fn is_any(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_i16(&self) -> bool
pub fn is_i32(&self) -> bool
pub fn is_i64(&self) -> bool
pub fn is_struct(&self) -> bool
pub fn is_array(&self) -> bool
pub fn as_llvm_type(&self) -> LLVMType
pub fn get_alias_name(&self) -> Option<String>
pub fn get_struct_fields(&self) -> Option<&Vec<(String, Type)>>
pub fn is_closure(&self) -> bool
pub fn is_alias(&self) -> bool
pub fn get_function_return_type(&self) -> Option<Type>
pub fn get_element_type(&self) -> Option<&Type>
pub fn get_env_type(&self) -> Option<Type>
pub fn get_closure_name(&self) -> Option<String>
pub fn get_closure_fn_gen_type(&self) -> Option<Type>
pub fn set_enum_name(&mut self, name: String)
pub fn has_alias(&self) -> bool
pub fn as_str(&self) -> String
pub fn is_enum(&self) -> bool
pub fn get_enum_name(&self) -> Option<&str>
pub fn get_enum_variants(&self) -> Option<&Vec<(String, Option<Type>)>>
pub fn is_vararg_function(&self) -> bool
Trait Implementations§
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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