#[non_exhaustive]pub enum TypeKind {
Show 30 variants
BuiltIn,
Enum,
ErrorContext,
Flags,
FunctionFreestanding,
FunctionMethod,
FunctionStatic,
Future,
InterfaceDeclaration,
InterfacePath,
List,
NamespaceDeclaration,
NamespacePath,
Option,
PackageNameDeclaration,
PackageNamePath,
Record,
Resource,
Result,
Stream,
Tuple,
TypeAlias,
TypeImport,
TypeName,
Variant,
VersionDeclaration,
VersionPath,
VersionAnnotation,
WorldDeclaration,
Other,
}
Expand description
Represents the different kinds of types that can be encountered while visiting a WIT file.
Each variant refers to the name of the respective element (e.g., function, type, or namespace), not the entire declaration.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BuiltIn
A built-in type, such as “list” or “option”.
Enum
An enumeration type name.
ErrorContext
An error-context type name.
Flags
A flags type name.
FunctionFreestanding
A freestanding function name, not associated with any specific type or namespace.
For example, “myfunc” in myfunc: func() -> string;
.
FunctionMethod
A method, associated with a resource.
FunctionStatic
A static function, associated with a resource.
Future
A future type name.
InterfaceDeclaration
An interface declaration name.
InterfacePath
An interface name when printing a path, for example in use
.
List
A list type name.
NamespaceDeclaration
A namespace declaration.
NamespacePath
A namespace when printing a path, for example in use
.
Option
An option type name.
PackageNameDeclaration
A package name declaration.
PackageNamePath
A package name when printing a path, for example in use
.
Record
A record type name.
Resource
A resource type name.
Result
A result type name.
Stream
A stream type name.
Tuple
A tuple type name.
TypeAlias
A type alias.
TypeImport
An imported type name.
TypeName
A user-defined type name.
Variant
A variant type name.
VersionDeclaration
A version declaration.
VersionPath
A version when printing a path, for example in use
.
VersionAnnotation
A version when printing stability annotations, for example in @since
WorldDeclaration
A world declaration name.
Other
A fallback for types that do not fit into any other category.