pub enum TypeExpr<'a> {
Simple(&'a str, Vec<TypeExprParam<'a>>, bool),
UserDefined(&'a str, Vec<TypeExprParam<'a>>, bool),
TypeVariable(u32, bool),
}Available on crate feature
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 ConcreteType 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)
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).
Trait Implementations§
Source§impl<'a> TryFrom<TypeExpr<'a>> for ConcreteType
impl<'a> TryFrom<TypeExpr<'a>> for ConcreteType
impl<'a> StructuralPartialEq for TypeExpr<'a>
Auto Trait Implementations§
impl<'a> Freeze for TypeExpr<'a>
impl<'a> RefUnwindSafe for TypeExpr<'a>
impl<'a> Send for TypeExpr<'a>
impl<'a> Sync for TypeExpr<'a>
impl<'a> Unpin for TypeExpr<'a>
impl<'a> UnwindSafe for TypeExpr<'a>
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