Enum full_moon::ast::types::TypeInfo [−][src]
#[non_exhaustive] pub enum TypeInfo<'a> { Array { braces: ContainedSpan<'a>, type_info: Box<TypeInfo<'a>>, }, Basic(TokenReference<'a>), Callback { parentheses: ContainedSpan<'a>, arguments: Punctuated<'a, TypeArgument<'a>>, arrow: TokenReference<'a>, return_type: Box<TypeInfo<'a>>, }, Generic { base: TokenReference<'a>, arrows: ContainedSpan<'a>, generics: Punctuated<'a, TypeInfo<'a>>, }, Intersection { left: Box<TypeInfo<'a>>, ampersand: TokenReference<'a>, right: Box<TypeInfo<'a>>, }, Module { module: TokenReference<'a>, punctuation: TokenReference<'a>, type_info: Box<IndexedTypeInfo<'a>>, }, Optional { base: Box<TypeInfo<'a>>, question_mark: TokenReference<'a>, }, Table { braces: ContainedSpan<'a>, fields: Punctuated<'a, TypeField<'a>>, }, Typeof { typeof_token: TokenReference<'a>, parentheses: ContainedSpan<'a>, inner: Box<Expression<'a>>, }, Tuple { parentheses: ContainedSpan<'a>, types: Punctuated<'a, TypeInfo<'a>>, }, Union { left: Box<TypeInfo<'a>>, pipe: TokenReference<'a>, right: Box<TypeInfo<'a>>, }, Variadic { ellipse: TokenReference<'a>, type_info: Box<TypeInfo<'a>>, }, }
Expand description
Any type, such as string
, boolean?
, number | boolean
, etc.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
A shorthand type annotating the structure of an array: { number }
Show fields
Fields of Array
braces: ContainedSpan<'a>
The braces ({}
) containing the type info.
type_info: Box<TypeInfo<'a>>
The type info for the values in the Array
Basic(TokenReference<'a>)
A standalone type, such as string
or Foo
.
A callback type, such as (string, number) => boolean
.
Show fields
Fields of Callback
parentheses: ContainedSpan<'a>
The parentheses for the arguments.
arguments: Punctuated<'a, TypeArgument<'a>>
The argument types: (string, number)
.
arrow: TokenReference<'a>
The “thin arrow” (->
) in between the arguments and the return type.
return_type: Box<TypeInfo<'a>>
The return type: boolean
.
A type using generics, such as map<number, string>
.
Show fields
Fields of Generic
base: TokenReference<'a>
The type that has generics: map
.
arrows: ContainedSpan<'a>
The arrows (<>
) containing the type parameters.
generics: Punctuated<'a, TypeInfo<'a>>
The type parameters: number, string
.
An intersection type: string & number
, denoting both types.
Show fields
Fields of Intersection
left: Box<TypeInfo<'a>>
The left hand side: string
.
ampersand: TokenReference<'a>
The ampersand (&
) to separate the types.
right: Box<TypeInfo<'a>>
The right hand side: number
.
A type coming from a module, such as module.Foo
Show fields
Fields of Module
module: TokenReference<'a>
The module the type is coming from: module
.
punctuation: TokenReference<'a>
The punctuation (.
) to index the module.
type_info: Box<IndexedTypeInfo<'a>>
The indexed type info: Foo
.
An optional type, such as string?
.
Show fields
Fields of Optional
base: Box<TypeInfo<'a>>
The type that is optional: string
.
question_mark: TokenReference<'a>
The question mark: ?
.
A type annotating the structure of a table: { foo: number, bar: string }
Show fields
Fields of Table
braces: ContainedSpan<'a>
The braces ({}
) containing the fields.
fields: Punctuated<'a, TypeField<'a>>
The fields: foo: number, bar: string
.
A type in the form of typeof(foo)
.
Show fields
Fields of Typeof
typeof_token: TokenReference<'a>
The token typeof
.
parentheses: ContainedSpan<'a>
The parentheses used to contain the expression.
inner: Box<Expression<'a>>
The inner expression: foo
.
A tuple expression: (string, number)
.
Show fields
Fields of Tuple
parentheses: ContainedSpan<'a>
The parentheses used to contain the types
types: Punctuated<'a, TypeInfo<'a>>
The types: (string, number)
.
A union type: string | number
, denoting one or the other.
Show fields
Fields of Union
left: Box<TypeInfo<'a>>
The left hand side: string
.
pipe: TokenReference<'a>
The pipe (|
) to separate the types.
right: Box<TypeInfo<'a>>
The right hand side: number
.
A variadic type: ...number
.
Show fields
Fields of Variadic
ellipse: TokenReference<'a>
The ellipse: ...
.
type_info: Box<TypeInfo<'a>>
The type that is variadic: number
.
Trait Implementations
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
The start position of a node. None if can’t be determined
The end position of a node. None if it can’t be determined
Whether another node of the same type is the same as this one semantically, ignoring position
The token references that comprise a node
The full range of a node, if it has both start and end positions
The tokens surrounding a node that are ignored and not accessible through the node’s own accessors. Use this if you want to get surrounding comments or whitespace. Returns a tuple of the leading and trailing trivia. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for TypeInfo<'a>
impl<'a> UnwindSafe for TypeInfo<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more