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.
Variants§
Simple(&'a str, Vec<TypeExprParam<'a>>, bool)
A type with a name, optional parameters, and nullability
UserDefined(&'a str, Vec<TypeExprParam<'a>>, bool)
A user-defined extension type, indicated by u!Name, with optional
parameters and nullability
TypeVariable(u32, bool)
Type variable (e.g., any1, any2)
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)