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

Is there a way to overload "()"? #2

Open
dbsxdbsx opened this issue Oct 8, 2022 · 2 comments
Open

Is there a way to overload "()"? #2

dbsxdbsx opened this issue Oct 8, 2022 · 2 comments

Comments

@dbsxdbsx
Copy link

dbsxdbsx commented Oct 8, 2022

I wonder if there is a way to overload parenthesis in rust, like this:

let  x = MyStrcut();

let y = x();// or more complex like  let y = x(1,"dd");

I know how to overload arithmetic and "[]", but not the case of parenthesis.

(I know here may not be the right place to ask this. But I just googled and found your crate. Hope this could give your crate some population.^_^)

@danaugrs
Copy link
Owner

Hi! It looks like that is now possible via Fn, FnOnce, and FnMut. I'll keep this issue open to track this.

@dbsxdbsx
Copy link
Author

Thanks, feel free to close if it is supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants