pub enum TypeRef {
Primitive(String),
Custom(Ident),
Generic {
base: Box<TypeRef>,
params: Vec<TypeRef>,
},
Function {
params: Vec<TypeRef>,
return_type: Box<TypeRef>,
},
Tuple(Vec<TypeRef>),
Array {
element_type: Box<TypeRef>,
size: Option<usize>,
},
Reference {
target: Box<TypeRef>,
mutable: bool,
},
}
Expand description
A type reference, which can be a primitive type, a custom type, or a generic type.
Variants§
Primitive(String)
A primitive type (i32, bool, etc.)
Custom(Ident)
A custom type (MyStruct, etc.)
Generic
A generic type (Vec
Function
A function type (Fn(A, B) -> C)
Tuple(Vec<TypeRef>)
A tuple type ((A, B, C))
Array
An array type ([T; N])
Reference
A reference type (&T or &mut T)
Trait Implementations§
impl StructuralPartialEq for TypeRef
Auto Trait Implementations§
impl Freeze for TypeRef
impl RefUnwindSafe for TypeRef
impl Send for TypeRef
impl Sync for TypeRef
impl Unpin for TypeRef
impl UnwindSafe for TypeRef
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