251
252
 
 
253
254
 
 

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.

255
 
 

A cloudflare dev answered some questions in the reddit thread: https://www.reddit.com/r/rust/s/1Dm0KmhgzQ

256
257
258
259
 
 

cross-posted from: https://lemmy.ml/post/36542390

260
submitted 10 months ago by to c/rust@programming.dev
 
 

I can't figure out which crate(s) I should be using to create GUI applications. I only want to create simple 2D games like Conway's Game of Life, so I don't need anything fancy. At most I would like to be able to easily create polygons.

I've already looked at Are we game yet?, but it would be a waste of time to learn 20 different crates in order to decide on which one to use. Bevy is far too heavy and doesn't even work if you are low on memory. SDL3 isn't natively supported without some workarounds (but SDL2 is fine). Winit tries to use insecure X11 unless I manually add it as a dependency with the Wayland feature. I plan to eventually learn GTK4+Adwaitta, but that's unnecessary for simple games.

GUI in Rust seams like a mess. There's so many crates ranging from simple to complicated. Information becomes outdated quickly, so LLMs often fail to help. There's few clear comparisons between crates to help you decide, so it becomes a headache. I'm just looking for a modern, safe, easy, minimal GUI crate.

Does anyone have any advice?

261
262
submitted 10 months ago* (last edited 10 months ago) by to c/rust@programming.dev
 
 

Why can't I open the thing it nags me about an operator but how is that relevant I'm just trying to open the thing

263
264
 
 

There has been another major update for Graphite.rs

For those who are not yet familiar with Graphite:

Graphite is a free, open-source editor for vector and raster graphics, currently available in alpha version. Get creative with a fully non-destructive editing workflow that combines layer-based compositing with node-based generative design.

265
Announcing Rust 1.90.0 (blog.rust-lang.org)
submitted 10 months ago by to c/rust@programming.dev
266
 
 

cross-posted from: https://lemmy.ml/post/36210816

asciinema (aka asciinema CLI or asciinema recorder) is a command-line tool for recording and live streaming terminal sessions.

This is a complete rewrite of asciinema in Rust, upgrading the recording file format, introducing terminal live streaming, and bringing numerous improvements across the board.

267
 
 

cross post from: https://programming.dev/post/37369902

Hi everyone,

we, the iceoryx community, just released iceoryx2 v0.7, an ultra-low latency inter-process communication framework for Rust, C, C++ and with this release, Python.

If you are into robotics, embedded real-time systems (especially safety-critical), autonomous vehicles or just want to hack around, iceoryx2 is built with you in mind.

Check out our release announcement for more details: https://ekxide.io/blog/iceoryx2-0-7-release

And the link to the project: https://github.com/eclipse-iceoryx/iceoryx2

268
 
 

I'm happy to announce the release of Diesel 2.3. This release contains various extensions to the query DSL provided by Diesel and enables using Diesel in web browsers via the wasm32-unknown-unknown target.

Checkout the full release announcements for more details.

As always you can support my work on Diesel by contributing or sponsoring the project.

I would like to use this possibility to thank NLNet Foundation for funding the newly added window function extension.

I'm happy to answer any question that comes up.

269
submitted 10 months ago by to c/rust@programming.dev
270
271
 
 

This crate contains a macro for generating a struct which reads the environmental variables defined in the configured file.

This allows to have a single point of definition for the env configuration, thus avoiding a possible incoherence between the documentation and the implementation.

GitHub link: https://github.com/asperan/declarative-env

Note: I'm the developer of this crate, I'm sharing this hoping that it could help someone

272
submitted 10 months ago by to c/rust@programming.dev
 
 

Takes places May 18-23 in Utrecht, NL. Who's thinking of going?

273
274
275
view more: ‹ prev next ›