Hey all, just wondering if there are blogs or podcasts out there that cover common design patterns in Rust. I'm a Java dev and have tried a few times to get into Rust, but it feels like I'm solving problems in a way that aren't the most optimal for Rust because I'm still in that Java mindset.
Anyway I'm working on an XMPP client and my current challenge is working to implement some sort of event/listener system where I can trigger functions when I receive certain XMPP message types.
I put together a simple XML parser to deserialize (haven't done serialisation yet) messages which I can then determine the type of message it is. I was thinking maybe an event driven setup might work best here but not sure where to start in a Rust idiomatic way.
The idea would be we receive a Proceed message for TLS negotiation, this would trigger the tls_upgrade function which itself will send messages and need to react to the response as part of the negotiation step. But, again I'm not sure this would even be the best approach.
What I'm doing now is calling the tls_upgrade function which will do its own handling of sending a negotiation message, then looping on read_line on the stream hoping that the next message is the next needed message in the negotiation process.
So some advice on common patterns used in Rust in blog form or even podcasts would be a good learning resource.
Cheers.