Rust Programming
!rust@lemmy.ml
help-circle
rss
Dedicated lemmy instance for rustaceans
pin
Hopefully, I'm not breaking any rules by posting this here! I thought that instead of every community being on the main lemmy.ml instance I'd host a different (dedicated) instance for refugee rustaceans to get a hang of the fediverse. It's listed on [join-lemmy/instances](https://join-lemmy.org/instances) and the link is [lemmyrs.org](https://lemmyrs.org), everyone is welcome!
fedilink




Which is faster?
``` let mut variable: Type; loop { variable = value; } ``` or ``` loop { let variable: Type = value; } ```
fedilink

New to Rust
Hey fellas, I am new to Rust! I have been following the rustlings tutorial + the rust online book, and I have just purchased the book "Rust for Rustaceans: Idiomatic Programming For Experienced Developers". While I am NOT an experienced developer, I have worked in languages such as Java, Python, and a little bit of C before, and my schooling was in information technology for computer systems infrastructure so most of the ideas are not too foreign to me (except for ownership in rust, which from what I have been reading is super cool, though it throws a wrench into how I might usually write something while opening some other doors). I am interested in learning, so I wanted to ask if, in addition to the resources I have selected above, is there anything else I should add to try to supplement my learning, or are those reasonably acceptable? I am also glad to hear any tidbits, advice, or suggestions otherwise. Thank you.
fedilink

Confession
I have been programming in Rust for about 8 years now. I love the language. But I feel I have some confessions I must make. 1. I don't know if I use tabs or spaces in my final code. I just assume that it all get solved correctly by cargo fmt. I don't even understand that people have been arguing about this for real? I vaguely remember this being important in C and C++, but I am hoping I never go back to those dark days. 2. I never do linebreaks, not even when adding my semicolons. I hit ":w" and if shit doesn't move around on my screen, I fucked up somewhere. 3. The only lifetime I ever use is '_, 'a or 'static otherwise I give up 4. Wtf is the 'de lifetime in serde deserialize?? 5. Rocket is the best web server 6. I actively chose software written in Rust over other software, even if it's not better, and I argue that it is. Okay, got that of my chest. Never dared telling anyone this before. Feels scary
fedilink

Managarr v0.5.1 is Out with Multi-Instance support!
[Managarr - A TUI and CLI to help you manage your Servarrs.](https://github.com/Dark-Alex-17/managarr) Thanks to everyone who contributed to this release, be that in code, issues, or enhancement suggestions! You all help fuel my passion for working on this and it doesn't go unappreciated! 😄 As always, you can try out the changes yourself via the [Managarr Demo Site](https://managarr-demo.alexjclarke.com) ## Breaking Changes * Managarr now supports multiple instances of the same Servarr with custom names and ordering. (See [Features](#features) below) To accommodate this, configuration files must be updated so that all Servarrs listed beneath `radarr`, `sonarr`, etc., be updated to be lists, not individual Servarrs. For example: to migrate from the following config: ``` radarr: host: 192.168.0.78 port: 7878 api_token: someApiToken1234 sonarr: host: 192.168.0.89 port: 8989 api_token: someApiToken1234 ``` You would change the above configuration to the following: ``` radarr: - host: 192.168.0.78 port: 7878 api_token: someApiToken1234 sonarr: - host: 192.168.0.89 port: 8989 api_token: someApiToken1234 ``` * The `--config` flag has been renamed to `--config-file`to make it more clear what it does. ## Features * Users can now specify multiple instances of the same type of Servarr and give them custom names and ordering. This allows users to manage multiple instances of the same Servarr, such as an Anime and TV Show instance of Sonarr. To configure, add a list of Servarrs under the respective type (e.g. `radarr`, `sonarr`, etc.). ([#17](https://github.com/Dark-Alex-17/managarr/issues/17)) * You can specify ordering of your Servarrs and how they will appear in the UI via the `weight` field. The lower the weight, the further to the left the Servarr will appear in the UI. * You can also name your Servarrs whatever you wish. This name will be displayed in the UI. For example, to name your Sonarr instances: ``` sonarr: - name: Anime host: 192.168.0.89 api_token: someApiToken - name: TV Shows host: 192.168.0.88 api_token: someOtherApiToken ``` * This change also required the introduction of a new CLI flag to specify which Servarr you wish to interact with: `--servarr-name`. This corresponds directly to the value of the `name` field in your configuration. If you did not specify a `name` in the configuration, then default names are provided for you corresponding to the Servarr; For example, if you defined two Radarr instances with no names, they will be named `Radarr 1` and `Radarr 2`, respectively. * Omitting the `--servarr-name` flag with multi-instance configurations will default to using the first instance that appears in your config. For example, for the following configuration: ``` sonarr: - host: 192.168.0.89 api_token: someApiToken - host: 192.168.0.88 api_token: someOtherApiToken ``` Running `managarr sonarr list series` will default to interacting with the Sonarr instance at `192.168.0.89`. This is the same as running `managarr sonarr list series --servarr-name 'Sonarr 1'`. * API tokens can now be fetched from files instead of needing to be hardcoded ([#31](https://github.com/Dark-Alex-17/managarr/issues/31)). The following is an example config that loads the API token from a file: ``` radarr: - host: 192.168.0.78 api_token_file: /home/root/.config/radarr_token ``` * Configurations now interpolate environment variables ([#23](https://github.com/Dark-Alex-17/managarr/issues/23)). This allows you to load sensitive information from environment variables. For example, to load the API token from an environment variable, you can do the following: ``` radarr: - host: 192.168.0.78 api_token: ${MY_RADARR_API_TOKEN_ENV_VAR} ``` This is available for all fields in the configuration file. ## Security Updates * Updated OpenSSL to v0.10.70 to mitigate [CVE-2025-24898](https://github.com/advisories/GHSA-rpmj-rpgj-qmpm) ## Miscellaneous * [Managarr now has a Matrix space!](https://matrix.to/#/#managarr:matrix.org) Feel free to drop in and message me directly if you're looking to discuss features, ideas, or just want to say, "Hi!".
fedilink

Unpopular opinion, but I like writing Rust code in camelCase.
I came from Java, so it kind of makes sense. I'm glad the Rust devs thought to allow disabling non-snake_case warnings. This language is actually really great and versatile. (I also use tabs instead of spaces)
fedilink

Axium - An example API built with Rust, Axum and SQLx
Hi there! Just wanted to share a project I worked on over the past 6 weeks. It is a boilerplate/template for a fairly secure API. It now features: - An example API, - JWT auth (using APIkeys and username + password (+ 2 factor)) - Key rotation, - Built-in HTTPS/HTTP2, - Multiple keys per account, - Usage tiers, - Role based access, - Healthcheck endpoint for monitoring and docker, - OpenAPI documentation generation, - And a lot more... This was my first Rust project. I am always in for feedback :)
fedilink


Big released bevy games
Are there some big projects/games that are released and made in bevy? A lot of times tiny glade is mentioned, but I can not find a reliable source from the devs that it is made in bevy.
fedilink

Is there any drag and drop method to develop a GUI with Rust?
I've used Godot, which works great but I'm wondering if there are other ways. Does anyone have experience using Qt with Rust and Qt Designer? Are there any other drag and drop options that you think are viable?
fedilink



Rust Actor Programming | My work at ockam.io
An interesting video about actor programming in Rust.
fedilink

Iced (GUI Crate) is getting default animation support
Iced, a popular GUI Crate, used by system76 for their new DE, is getting default animation support in the development branch. The animations are based on the lilt crate. As far as I know the only missing part that needs to be done is, adding animations to the default widgets. I assume in the next release it will be shipped with animation support. I am so happy that this is coming and look forward to see animations in my gui applications.
fedilink

Abstract Impl: code generic trait implementations
cross-posted from: https://feddit.org/post/7326044 > Inspired by [Contex-Generic Programming](https://contextgeneric.dev/), I made this macro, that allows you to write those generic implementations easily. This is kinda CGP, but simple and with better errors. > > Ever repeat yourself implementing traits? Or wanted to easily swap out parts of your code, with (almost) no need to refactor? That is what this is for.
fedilink

Persy single file storage new relese
New Release 1.6.0 of Persy single file embedded storage is out Persy is a single file transactional embedded storage, is scope is become a base of persistent databases implementations or for simple low level database to embed in application. This is a new minor release 1.6.0 that include a simple feature that allow to create snapshots from the commit of a transaction, release post with all details here: https://persy.rs/posts/persy-1.6.html
fedilink


Rust Programming
!rust@lemmy.ml
    • 0 users online
    • 15 users / day
    • 18 users / week
    • 29 users / month
    • 93 users / 6 months
    • 1 subscriber
    • 311 Posts
    • 958 Comments
    • Modlog
    Lemmy
    A community of privacy and FOSS enthusiasts, run by Lemmy’s developers

    What is Lemmy.ml

    Rules

    1. No bigotry - including racism, sexism, ableism, homophobia, transphobia, or xenophobia. Code of Conduct.
    2. Be respectful, especially when disagreeing. Everyone should feel welcome here.
    3. No porn.
    4. No Ads / Spamming.

    Feel free to ask questions over in: