dyon icon indicating copy to clipboard operation
dyon copied to clipboard

Rust object shorthand syntax in macros

Open bvssvni opened this issue 4 years ago • 0 comments

Dyon supports a shorthand syntax for Rust objects in the dyon_fn macro:

dyon_fn{fn foo(a: #Foo) {
    ...
}}
  • #Foo - by value (requires the Copy trait)
  • #&Foo - by reference
  • #&mut Foo by mutable reference

One can also use #Foo as return type:

dyon_fn{fn new_foo() -> #Foo { ... }}

bvssvni avatar Jun 22 '20 11:06 bvssvni