Closed MavethGH closed 8 months ago
Looking good!
Let me know when to merge.
So below is list of all the attributes so far...
pub
or private) will be exported
skip
attribute#[readonly]
=> only getter, no setter#[get]
=> generated getter
#[get(func_name)]
=> use func_name
as getter function#[set]
=> generated setter
#[set(func_name)]
=> use func_name
as setter functionDid I miss anything?
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...
I'll open another tracking issue...
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:
TypeBuilder
passed infield0
,field1
, etc perhaps?