pub enum Type {
Int,
Num,
Bool,
Logical,
String,
Tensor {
shape: Option<Vec<Option<usize>>>,
},
Cell {
element_type: Option<Box<Type>>,
length: Option<usize>,
},
Function {
params: Vec<Type>,
returns: Box<Type>,
},
Void,
Unknown,
Union(Vec<Type>),
Struct {
known_fields: Option<Vec<String>>,
},
}Expand description
Enhanced type system used throughout RunMat for HIR and builtin functions Designed to mirror Value variants for better type inference and LSP support
Variants§
Int
Integer number type
Num
Floating-point number type
Bool
Boolean type
Logical
Logical array type (N-D boolean array)
String
String type
Tensor
Tensor type with optional shape information (column-major semantics in runtime)
Fields
Cell
Cell array type with optional element type information
Fields
Function
Function type with parameter and return types
Void
Void type (no value)
Unknown
Unknown type (for type inference)
Union(Vec<Type>)
Union type (multiple possible types)
Struct
Struct-like type with optional known field set (purely for inference)
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Type
impl<'de> Deserialize<'de> for Type
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Type, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Type, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Type
impl Serialize for Type
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.