orga icon indicating copy to clipboard operation
orga copied to clipboard

Require call attribute on accessible fields

Open cwlittle opened this issue 3 years ago • 1 comments

cwlittle avatar Jul 27 '22 18:07 cwlittle

Rationale:

  • Could prevent accidentally exposing some unprotected calls since it might not be obvious that every public field is callable.
  • Generated call enums currently have a bunch of variants for every public field even when they are often just simple data values which don't themselves have any calls. This change will make the call enums cleaner for once they are viewable through devtools, etc.

Notes: We currently implement #[call] (and #[query]) as standalone no-op attribute macros since they are only currently used on methods. But since we are now adding #[call] to fields, it should be implemented as a helper attribute under the Call derive macro (https://doc.rust-lang.org/reference/procedural-macros.html#derive-macro-helper-attributes).

mappum avatar Jul 27 '22 19:07 mappum