[−][src]Crate tealr
tealr
A wrapper around rlua to help with embedding teal
tealr adds some traits that replace/extend those from rlua, allowing it to generate the .d.tl
files needed for teal.
Small example
#[derive(Clone,Copy,TealDerive)] struct Example {} impl TealData for Example { } fn main() -> Result<()> { let file_contents = TypeWalker::new() .proccess_type::<Example>() .generate_global("test") .expect("oh no :("); println!("{}\n ", file_contents); Ok(()) }
You can find longer ones here
Future plans
Its possible for lua to load .tl files directly after it loaded the compiler. I would like to make use of this and expose methods that already perpare the lua vm in this way.
This should make it pretty much as easy to work with teal as with lua. However, I am not sure if doing this breaks any rules from rlua. As such, some research is required.
Structs
TealType | Represents a type |
TypeWalker | This generates the .d.tl files |
UserDataWrapper | Used to turn UserDataMethods into TealDataMethods. |
Traits
TealData | This is the teal version of UserData. |
TealDataMethods | The teal version of UserDataMethods |
TealMultiValue | A collection of TealValues. |
TypeRepresentation | A trait to collect the required type information like the name of the type. |
UserData | Trait for custom userdata types. |
Derive Macros
TealDerive | Implement both UserData and TypeRepresentation. |
TypeRepresentation | Implements TypeRepresentation. |
UserData | Implements UserData. |