
Empowering everyone to build reliable and efficient software.

Welcome to the Rust community! This is a place to discuss about the Rust programming language.
How do you implement API Keys?
So I've had this idea for an API for a while but the problem I keep coming back to is authentication. I'm using rocket to actually code it. I looked through the rocket docs and it looks like the closest thing to API key authentication it has are cookies.
I then went and looked at some other APIs to see if I can copy their layouts and it looks like a lot of them use an API key and then a secret API key for authentication. Did some more googling and stackoverflow said that it's more secure to use a pair like that.
So that leaves me with the actual question: how do you actually implement this feature? Do you just generate API keys and throw them a database to be looked up later? Should they be written/read to a file to be used later(probably not a good option I'd guess).
Just for reference I'm using rocket, sqlx and postgres.
Announcing Rust 1.87.0 and ten years of Rust!
Empowering everyone to build reliable and efficient software.
I see people make the same mistakes over and over again when learning Rust. Here are my thoughts (ordered by importance) on how you can ease the learning process. My goal is to help you save time and frustration. <…
Broadcast vs mpsc channels?
Hello, I am starting to learn and play around with tokio and multithreaded code. I am now playing around with websockets, I don't quite understand the difference between broadcast and mpsc, and when would you use either, I mean, I am assuming broadcast is intended for multiple clients, but multiple clients were able to connect to my mscp channel, and receive a bit of data (but it was weird and partial). So I don't quite get it.
cross-posted from: https://programming.dev/post/30061235
As part of this expansion, Qt Group will introduce new bridging technology that integrates Qt with any programming language of choice, initially including Rust, Python, .NET, Swift, and Kotlin/Java.
I'd really like to use Qt for GUI and HMI development for certified medical devices using embedded hardware, but wasn't looking forward to all the conventional C++ that would have entailed. Looks using Rust with Qt may get better soon?
Second source reporting from Qt World Summit in Munich:
Part of the thinking here is that C++ is regarded as an unsafe language whereas the languages supported by Qt Bridges are safe languages, potentially escaping the notion that because Qt is C++, it is not as safe to use.
The Rust Project is participating in Google Summer of Code (GSoC) again this year
Empowering everyone to build reliable and efficient software.
Looking at C++ from another angle can create new possibilities using Rust.
Inferred types for function calls?
Hello, I'm fairly new to Rust and came across this. Can someone explain to me how the following example is able to infer the constant value from the array length passed in? At this point, inferred type generation for function calls are a bit hand wavy, to me, does anyone know of a resource that breaks down all the different ways they can be used (for instance in this example I hadn't seen them used for consts) and what their limitations are in Rust? I often run across a 'this type can not be inferred' error without really knowing why not and just throw in the type to make it go away.
Any other examples people could point me to would be appreciated as well.
Thanks!
Rust
#[derive(Debug)] struct Buffer<T, const LENGTH: usize> { buf: [T; LENGTH], } impl<T, const LENGTH: usize> From<[T; LENGTH]> for Buffer<T, LENGTH> { fn from(buf: [T; LENGTH]) -> Self { Buffer { buf } } } fn main() { let buf = Buffer::from([0, 1, 2, 3,5]); dbg!(&buf); }
Edit: for s
Stack advice
Hey all, just looking for some advice. I'd like to do a WASM application, just generally like a calendar + notes app. I'd like it to work on mobile and desktop through the browser. It'll be served through Actix with Diesel for the backend. For the "frontend" I was thinking egui or leptos.
I'd like to avoid any JavaScript, so thought SSR might be the best approach.
Any thoughts/pitfalls? Should I look at something else for the frontend?
Its a lot of working parts for a calendar + notes app, but this will be a testing ground to see if I can get it all going :S
iocraft: A crate for beautiful, artisanally crafted CLIs, TUIs, and text-based IO using React-like components
A Rust crate for beautiful, artisanally crafted CLIs, TUIs, and text-based IO. - ccbrown/iocraft
The new BLAKE3 hazmat API, or why we can retire our BLAKE3 fork
Announcing rustup 1.28.2
Empowering everyone to build reliable and efficient software.
Showcase: Axium, an example API
Hi there Rustians! A few months ago I posted about my hobby project. Just wanted to give an update.
Axium is a template for an API backend.
In the last few months I have added:
I think that it is almost ready to be used as a backend for my website. Almost everything is marked off my wishlist, just need a few helper to help me check the security of the authentication and registration functions.
The other day, while running incremental backups on my laptop, I was struck by a familiar yet unwelcome sight: a steady stream of changed files. Despite primarily working on just a few personal Rust projects in my free time, the sheer volume of modifications was significant. It brought back vivid me...
This article delves into various techniques for reclaiming disk space from Cargo build artifacts.
Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever!
Kellnr has a new UI
Kellnr, the registry to self host crates, has a new UI. I rewrote it to make it more consistent and responsive. Give it a try, if you want to host crates on your own infrastructure. https://kellnr.io/
We'll explore how we can leverage all cores on a machine with rustc using many crates to speed up compilation.
Instead of emitting one giant crate containing everything, we tweaked our SQL-to-Rust compiler to split the output into many smaller crates. Each one encapsulating just a portion of the logic, neatly depending on each other, with a single top-level main crate pulling them all in.
Rust GUI survey 2025
I did this in 2020 and then again in 2021, but I’m in the mood to look around again. Let’s look through Are We GUI Yet? and see what’s up these days.
crates.io security incident: improperly stored session cookies