Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust object shorthand syntax in macros #661

Open
bvssvni opened this issue Jun 22, 2020 · 0 comments
Open

Rust object shorthand syntax in macros #661

bvssvni opened this issue Jun 22, 2020 · 0 comments
Assignees

Comments

@bvssvni
Copy link
Member

bvssvni commented Jun 22, 2020

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 { ... }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant