pub enum TypeExpr<'a> {
Simple(&'a str, Vec<TypeExprParam<'a>>, bool),
UserDefined(&'a str, Vec<TypeExprParam<'a>>, bool),
TypeVariable(u32, bool),
Func(Vec<TypeExprParam<'a>>, Box<TypeExpr<'a>>, bool),
}parse only.Expand description
A parsed type expression from a type string, with lifetime tied to the original string.
This represents the syntactic structure only - type names are not validated.
Convert to Type for semantic validation.
Variants§
Simple(&'a str, Vec<TypeExprParam<'a>>, bool)
A type without the u! prefix (expected to be a builtin like i32, List, etc.)
Contains: (name, parameters, nullable)
UserDefined(&'a str, Vec<TypeExprParam<'a>>, bool)
A user-defined extension type with the u! prefix (e.g., u!geometry)
Contains: (name without u! prefix, parameters, nullable)
TypeVariable(u32, bool)
Type variable (e.g., any1, any2)
Contains: (variable id, nullable)
Func(Vec<TypeExprParam<'a>>, Box<TypeExpr<'a>>, bool)
A function type (e.g., func<i32 -> i64>)
Contains: (parameters, return type, nullable)
Implementations§
Source§impl<'a> TypeExpr<'a>
impl<'a> TypeExpr<'a>
Sourcepub fn parse(type_str: &'a str) -> Result<Self, TypeParseError>
pub fn parse(type_str: &'a str) -> Result<Self, TypeParseError>
Parse a type string into a TypeExpr.
Sourcepub fn visit_references<F>(&self, on_ext: &mut F)
pub fn visit_references<F>(&self, on_ext: &mut F)
Visit all extension type references contained in a parsed type, calling on_ext
for each encountered extension name (including named extension forms).