-
Notifications
You must be signed in to change notification settings - Fork 960
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
#[derive(NetworkBehaviour)] doesn't work as documented when out_event is set #2663
Comments
Hi @jacklund, I think the reason for your error is that So it would have to be #[derive(NetworkBehaviour)]
#[behaviour(out_event = "Event")] // Note the quotation marks around "Event".
struct MyBehaviour { If the syntax is incorrect, the Imo it would be easier to debug this if we just panic within the macro if the syntax is incorrect. I would propose to do that in an rust-libp2p/swarm-derive/src/lib.rs Lines 113 to 116 in ef2afcd
What do folks think? @jacklund Would you be interested in doing a PR for this? |
🤦♂️ Amazing how I saw the way to do it, but my brain put it without the quotes, I think because I'm used to that mode with Rust. I'll be happy to take a look at PR-ing that, thank you soooo much @elenaf9 for clearing that up!! |
Closing as stale. |
Summary
When using
#[derive(NetworkBehaviour)]
as documented here, I get a compiler error.Example code:
Expected behaviour
The code compiles
Actual behaviour
I get the following:
Note: This may be because of #2373
Possible Solution
Not sure, but I'm guessing that somehow the default
out_event
of()
is being used, somehow.Version
0.44.0
Would you like to work on fixing this bug?
Sure, but I'm not very familiar with the code, having just started playing with your very awesome library.
The text was updated successfully, but these errors were encountered: