pub enum TypeKind<'ast> {
Reference {
prefix: Option<AstName<'ast>>,
prefix_location: Option<Location>,
prefix_local: Option<&'ast Local<'ast>>,
name: AstName<'ast>,
location: Location,
name_location: Location,
has_parameter_list: bool,
parameters: &'ast [TypeOrPack<'ast>],
},
Table {
props: &'ast [TableTypeProp<'ast>],
indexer: Option<&'ast TableTypeIndexer<'ast>>,
},
Function {
attributes: &'ast [&'ast Attribute<'ast>],
generics: &'ast [&'ast GenericType<'ast>],
generic_packs: &'ast [&'ast GenericTypePack<'ast>],
arg_types: TypeList<'ast>,
arg_names: &'ast [Option<ArgumentName<'ast>>],
return_types: TypePack<'ast>,
},
Typeof {
expr: Expression<'ast>,
},
SingletonBool {
value: bool,
},
SingletonString {
value: AstString<'ast>,
},
Group {
ty: Type<'ast>,
},
Optional,
Union {
types: &'ast [Type<'ast>],
},
Intersection {
types: &'ast [Type<'ast>],
},
Error {
types: &'ast [Type<'ast>],
missing: bool,
message_index: usize,
},
}Variants§
Reference
Fields
§
parameters: &'ast [TypeOrPack<'ast>]Table
Function
Fields
§
generics: &'ast [&'ast GenericType<'ast>]§
generic_packs: &'ast [&'ast GenericTypePack<'ast>]§
arg_names: &'ast [Option<ArgumentName<'ast>>]Typeof
Fields
§
expr: Expression<'ast>SingletonBool
SingletonString
Group
Optional
Union
Intersection
Error
Implementations§
Source§impl<'ast> TypeKind<'ast>
impl<'ast> TypeKind<'ast>
pub fn is_checked_function(&self) -> bool
pub fn has_function_attribute(&self, kind: AttributeKind) -> bool
pub fn get_function_attribute( &self, kind: AttributeKind, ) -> Option<&'ast Attribute<'ast>>
Trait Implementations§
impl<'ast> Copy for TypeKind<'ast>
impl<'ast> StructuralPartialEq for TypeKind<'ast>
Auto Trait Implementations§
impl<'ast> !Send for TypeKind<'ast>
impl<'ast> !Sync for TypeKind<'ast>
impl<'ast> Freeze for TypeKind<'ast>
impl<'ast> RefUnwindSafe for TypeKind<'ast>
impl<'ast> Unpin for TypeKind<'ast>
impl<'ast> UnsafeUnpin for TypeKind<'ast>
impl<'ast> UnwindSafe for TypeKind<'ast>
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