Rust

6665 readers
12 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

[email protected]

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
1
 
 

It's getting more and more unhinged on LinkedIn.

2
13
Dyn you have idea for dyn? (smallcultfollowing.com)
submitted 2 days ago by [email protected] to c/rust
3
3
submitted 1 day ago by chrysn to c/rust
4
5
 
 
6
 
 

For my library, I want to replace async_std by smol, since the former has been deprecated in favor of the latter. This is mostly just a simple translation (different module structure, names etc.), but what I don't know is how to replace async-std's stdin. Anybody got a hint on that?

7
 
 

https://nlnet.nl/news/2025/20250321-call-announcement-core.html

Notes

  1. Projects meaningfully sharing two programming languages get 0.5 a point each, even if the split is not exactly half-half.
  2. Two projects are listed under "Multi/Misc/Other" which is opinionated, and some may disagree with.
  3. Three points (5 projects) are assigned to "Unaccounted/Not Available". Two of the projects have no code at all (related to the grant, or otherwise). One project with no published code is (charitably) listed under "Python", however, since the author mentions Python+QT as the choice for implementation.

9.5 (10 projects) Rust

https://git.joyofhardware.com/Products/FastWave2.0
https://github.com/slint-ui/slint
https://github.com/stalwartlabs/mail-server
https://github.com/dimforge
https://github.com/DioxusLabs/blitz
https://github.com/fdtshim
https://github.com/trynova/nova
https://github.com/yaws-rs
https://github.com/lycheeverse/lychee
https://git.syndicate-lang.org/synit/synit
(0.5 rust, 0.5 shell)

9 Python (8 + 1 project without code)

https://github.com/owasp-dep-scan/blint
https://github.com/web-platform-tests/wpt
https://github.com/niccokunzmann/open-web-calendar
https://git.xmpp-it.net/sch/Rivista
https://github.com/DataLab-Platform/DataLab
https://codeberg.org/IzzyOnDroid/rbtlog
https://gitlab.com/py3dtiles/py3dtiles
https://codeberg.org/flohmarkt/flohmarkt
https://rackweaver.app
(says python+qt, but no code yet)

6 (7 projects) C

https://mntre.com/sources.html
https://github.com/open-sdr/openwifi
https://wiki.musl-libc.org
https://github.com/LekKit/RVVM
https://github.com/skarnet/s6-rc
https://git.savannah.gnu.org/git/mes
(scheme interpreter, compiler + minimal libc in C = 0.5)
https://www.gnunet.org
(gnunet itself is C = 0.5, Anroid work would presumably use Java/Kotlin/Dart/... = 0.5 unaccounted)

3.5 (4 projects) TypeScript

https://github.com/cartesapp/cartes
https://github.com/edumeet
https://github.com/adorsys/open-banking-gateway
(0.5 Java, 0.5 TypeScript)
https://github.com/janeirodigital/sai-js
(grant is about specification work. But implementation is in TypeScript)

3.5 (4 projects) Java

https://github.com/slovensko-digital/autogram
https://github.com/igniterealtime/Openfire
https://github.com/MarginaliaSearch/MarginaliaSearch
https://github.com/adorsys/open-banking-gateway
(0.5 Java, 0.5 TypeScript)

3 Kotlin

https://github.com/florisboard/florisboard
https://github.com/EventFahrplan/EventFahrplan
https://github.com/tuskyapp/Tusky

2.5 (3 projects) Hardware/Verilog/...

https://github.com/opera-platform/opera-dsp
https://github.com/simple-crypto/SMAesH
https://github.com/IObundle/iob-versat
(hardware part = 0.5, software is C++)

2.5 (3 projects) Scheme

https://codeberg.org/spritely/goblins
https://nlnet.nl/project/SchemeTestingFramework
(no external link in grant page)
https://git.savannah.gnu.org/git/mes
(scheme interpreter, compiler + minimal libc in C = 0.5)

2.5 (3 projects) JavaScript

https://github.com/CycloneDX/cdxgen
https://github.com/overte-org/overte
(0.5 C++, 0.5 JS)
https://nlnet.nl/project/TALER-integration-Nuxt
(no external link)

2 Nix

https://nlnet.nl/project/Nix-ControlPlane
https://github.com/ibizaman/selfhostblocks
(no external link)

2 Go

https://github.com/namecoin/encaya
(namecoint-core is written in C++, but the grant is about encaya)
https://github.com/hockeypuck/hockeypuck

1.5 (3 projects) C++

https://github.com/IObundle/iob-versat
(software part = 0.5, hardware is Verilog)
https://github.com/overte-org/overte
(0.5 C++, 0.5 JS)
https://kde.org/plasma-desktop
(grant is about mobile power management improvements, no idea about the code, but KDE/Plasma is C++, so charitable 0.5 for C++, 0.5 unaccounted)

1 Clojure

https://github.com/NyanCAD/Mosaic

1 Assembly

https://lib25519.cr.yp.to
(grant covers NEON vector implementation)

1 Haskell

https://github.com/ghc-proposals/ghc-proposals

1 Julia

https://github.com/PeaceFounder/AppBundler.jl

0.5 Shell

https://git.syndicate-lang.org/synit/synit
(0.5 rust, 0.5 shell)

2* Multi/Misc/Other

https://github.com/IObundle/iob-linux
(build project, a mix of python, Make, and C from OpenSBI)
https://unifiedpush.org
(specification for Android and D-Bus. Implementations in Go, C, Kotlin, and Flutter)

3* (5 projects) Unaccounted/Not Available

https://www.gnunet.org
(possible non-native Android yet to be written)
https://kde.org/plasma-desktop
(grant is about mobile power management improvements, no idea about the code but, KDE/Plasma is C++, so 0.5 for C++, 0.5 unaccounted)
https://nlnet.nl/project/LicenseCompatibilityAutomation
(no external link or specific info about the implementation)
https://librediagnostic.com
(fully unaccounted, site pages "under construction")
https://github.com/mapterhorn
(fully unaccounted, from org readme "Coming soon...")

8
14
Memory safety for web fonts (developer.chrome.com)
submitted 1 week ago by [email protected] to c/rust
9
10
17
ICED (lemmy.world)
submitted 1 week ago* (last edited 1 week ago) by [email protected] to c/rust
 
 

I was hoping if I could get some help regarding Iced.rs (& maybe even advice on GUI-dev in general) since the documentation/book is a Work-In-Progress

11
21
submitted 1 week ago* (last edited 1 week ago) by [email protected] to c/rust
 
 

Question is how to do these in Rust. An example might be a browser DOM: each node has a parent pointer, a list of child pointers, left and right sibling pointers, maybe a CSS node pointer, etc. Inserting or deleting nodes has to repair the pointers to and from the neighboring nodes as needed.

I know this is doable since obviously Servo (Rust's initial driving application) has to do it. I hope the answer doesn't involve the word "unsafe". But I am quite unclear about how to create such a structure under Rust's rules of pointer ownership, and also how to reliably reclaim storage when nodes and trees/subtrees are deleted. Plus there will be thread safety rules that should be statically enforced if possible.

I've heard that doubly linked lists in Rust are handled by an unsafe library, yet this seems even worse. Thanks.

12
 
 

Is there any way I can automatically bundle the compiled binary with the current version number as a git tag to github when I do cargo publish like stuff? Like qol thing?

13
8
submitted 2 weeks ago by onlinepersona to c/rust
 
 

In terms of its usability, not its deficits.

14
15
55
submitted 3 weeks ago* (last edited 3 weeks ago) by fluffy_hub to c/rust
 
 

Hello,

This is my first post to this Rust community and I am happy to introduce myself and discuss what I love about this language, but first a little about myself.

I'm Alice, Fluffy to most, and she/her are my pronouns. I'm from the UK. I got a little boy who love like crazy. I'm Autistic, suffer from cPTSD and I also 🩷 Rust!!

Rust I feel appeals to Autistic people because of it's focus on accuracy and correctness. It's a common feeling people have about the language. But as the type of person I am I love it.

I began learning it in 2023, before this I was using C++. Rust showed me the importance of error's as values and helped improve the quality of my code.

Currently I'm writing a game-engine as a hobby. The game-engine is a work in progress (WIP) and I have only just begun it's development. Since the game-engine will natively support various platforms. To ensure consistency I'm writing all the platform specific code manually and building my own custom standard library for my engine, loosely based on the actual Rust standard library.

Right now I have the code in place to create/remove directories and to create, delete, write, read and set file pointer location. Convert UTF8 to UTF16 and output to the console in Unicode (Windows C API uses UTF16) and heap functions to get the process heap and create and delete memory dynamically.

Next will be the 'config.json' for which Serde will be used. Then the logger, and so on.

So it is a WIP but it's fun and given my conditions allows me to do what I love, writing Rust code.

Thanks for reading!!

Alice 🏳️‍⚧️

16
17
18
 
 

Managarr - A TUI and CLI to help you manage your Servarrs.

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

Breaking Changes

  • Managarr now supports multiple instances of the same Servarr with custom names and ordering. (See 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-fileto 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)

    • 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). 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). 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

Miscellaneous

19
20
18
submitted 1 month ago* (last edited 1 month ago) by [email protected] to c/rust
 
 

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 :)

21
16
submitted 1 month ago by KillTheMule to c/rust
 
 

If you belong to the group of people playing World of Warcraft on linux somewhat competitively (there must be dozens of us!), you might be interested in progrs. It is an alternative to warcraftrecorder and used to create videos of your play. It monitors the combat log for interesting events (for now, deaths of players) and creates chapters in the video for easier searching. For now, only "encounters" are supported (might mean just raid bosses, but I've not done any testing in M+), but each try will end up its own video, just as in warcraft recorder.

I'd be glad for anyone trying it out and giving feedback.

22
23
312
submitted 1 month ago* (last edited 1 month ago) by snaggen to c/rust
 
 

So let me be very clear: if you as a maintainer feel that you control who or what can use your code, YOU ARE WRONG.

24
89
submitted 1 month ago by snaggen to c/rust
25
59
submitted 1 month ago* (last edited 1 month ago) by KillTheMule to c/rust
 
 

Typst is "A new markup-based typesetting system that is powerful and easy to learn". It's written in Rust, and particularly attractive because, while providing a CLI interface, it is a proper library that you can easily incorporate into your progress to produce documents. Protip: If you do so, have a look at sys.inputs, it's awesome!

view more: next ›