rhaiscript / rhai

Rhai - An embedded scripting language for Rust.
https://crates.io/crates/rhai
Apache License 2.0
3.77k stars 178 forks source link

Add a derive macro for CustomType #817

Closed MavethGH closed 8 months ago

MavethGH commented 8 months ago

The macro currently generates getters and setters for all fields in the struct, and has helper attributes for overriding generated getter/setter functions. There is also a readonly helper attribute that prevents a setter from being registered.

TODOs:

schungx commented 8 months ago

Looking good!

Let me know when to merge.

schungx commented 8 months ago

So below is list of all the attributes so far...

Did I miss anything?

schungx commented 8 months ago

Unfortunately we cannot make #[get(func_name)] use a standard getter signature with &self instead of &mut self which is quite unusual for normal structs...

schungx commented 8 months ago

I'll open another tracking issue...