pub enum TypeKind {
Show 13 variants
Number,
String,
Bool,
Nil,
Any,
Color,
Surface,
InputEvent,
List(Box<TypeAnnotation>),
Record(Vec<RecordTypeField>),
Result(Box<TypeAnnotation>, Box<TypeAnnotation>),
Function {
params: Vec<TypeAnnotation>,
ret: Box<TypeAnnotation>,
},
Named(String),
}Expand description
The kind of type.
Variants§
Number
number
String
string
Bool
bool
Nil
nil
Any
any — stdlib-only, rejected in user code by the type checker
Color
color
Surface
Surface
InputEvent
InputEvent
List(Box<TypeAnnotation>)
list<T>
Record(Vec<RecordTypeField>)
{ name: string, age?: number } — anonymous record type
Result(Box<TypeAnnotation>, Box<TypeAnnotation>)
Result<T, E>
Function
(T1, T2) -> R — function type
Named(String)
User-defined type name (sum type or alias): Shape, Priority
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TypeKind
impl<'de> Deserialize<'de> for TypeKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 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