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

Support mut self in proc macros #1508

Open
peitalin opened this issue Dec 26, 2024 · 1 comment
Open

Support mut self in proc macros #1508

peitalin opened this issue Dec 26, 2024 · 1 comment

Comments

@peitalin
Copy link

Is it possible to define method handlers with the RPC proc macro that are mut self?
E.g.method(&mut self, param: T)

@niklasad1
Copy link
Member

Hey hey,

You are correct, it's not possible to define &mut self handlers within the proc macro API and I'm not sure how difficult it's to support because it may not satisfy trait bounds for async code with mutual borrows etc.

Can you explain what you want to do which doesn't work for right now?

I don't think there is a way around in the proc macros API but works if you register the methods yourself.

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