pub enum Type {
Function(FunctionRepresentation),
Single(SingleType),
Map(MapRepresentation),
Or(Vec<Type>),
Array(Box<Type>),
Tuple(Vec<Type>),
}
Expand description
A type
Variants§
Function(FunctionRepresentation)
The type is a function
Single(SingleType)
The type is a simple, singular type
Map(MapRepresentation)
The type is a Map<K,V> (Think HashMap<K,V> and similar)
Or(Vec<Type>)
The type is a union (A | B)
Array(Box<Type>)
The type is an array
Tuple(Vec<Type>)
This one doesn’t really exist in lua/teal but will expand in (A,B,C) Sometimes useful for the return type or parameters but should be used very carefully As it can easily break things
Implementations§
source§impl Type
impl Type
sourcepub fn new_single(name: impl AsRef<str>, kind: KindOfType) -> Self
pub fn new_single(name: impl AsRef<str>, kind: KindOfType) -> Self
Creates a new singular type
Examples found in repository?
More examples
Trait Implementations§
source§impl<'de> Deserialize<'de> for Type
impl<'de> Deserialize<'de> for Type
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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