r_rust🦀
64 subscribers
763 photos
66 videos
38K links
Posts top submissions from the rust subreddit every hour.

Powered by: @reddit2telegram
Chat: @r_channels
Download Telegram
Looking for OSS projects to contribute to

I want to improve my rust skills by contributing to OSS projects on a consistent basis.

My professional work involves a lot of rust but it's limited to web development. I want to explore other areas (Databases , AI toolchain , agent frameworks)

Is there anyone here who would like help on their project. Would love to collaborate.

https://redd.it/1unu4en
@r_rust
custom x86_64 rust microkernel with software ECC and a macOS-like desktop i've been writing
https://redd.it/1uo1rj8
@r_rust
Is Hyper crate independent of the async runtime? I want to use something that uses io-uring like monoio

Im building reverse proxy. Is there any other helpful crates for http-parsing and modifying headers.

https://redd.it/1unwlj2
@r_rust
Introducing hiper 0.5.0: maud alternative using decl macros

I spent the last week coding up this library to be an alternative option on HTML rendering via macros, like maud, vy and others.


My take on this one was to use as few dependencies as possible and keep the code terse and to the point. This comes with trade-offs, but I'm proud of what could be achieved with a little declarative macro magic.

I'm looking for feedback on the crate, questions, comments, anything!

Cheers!

PS: I'm aware of the [askama templating benchmarks\](https://github.com/askama-rs/template-benchmark) and I already have a local branch that puts this library in a competitive spot. I'll PR it later, just fixing a few things.


PPS: I used no AI on this project, not even for proof reading the README and stuff, so forgive me for typos (but point them out so I can fix them).

Github: https://github.com/lsunsi/hiper

Crates: https://crates.io/crates/hiper

Docs: https://docs.rs/hiper/latest/hiper/

https://redd.it/1uo6sfy
@r_rust
Drawing UI in rust is interesting

MacOS


Here is my simple landing page that using Rust \+ Wgpu and using WebGPU for rendering. first loading it would take some times.

https://aimer.cottonsofficial.com

https://redd.it/1uob6ap
@r_rust
insta snapshot testing and yaml failure

I'm working on a vb6 parsing library and I've just now started using some 'edge' tests, ie, source files which are just odd and weird and out of line. For example, I've got one module file that's almost 50k lines by itself. Now, the parser works great...chews through the file in less than 4ms. Wonderful! Except the insta snapshot crate takes literally *minutes* to produce a yaml file.

I need a real actual tree output so the `assert_debug_snapshot`, `assert_snapshot`, and `assert_compact_debug_snapshot` don't really work.

So, 'assert_yaml_snapshot` has been my only real option, but it's *slooooow* just, staggeringly slow and this added up, but with this new strange giant file it's just beyond too much.

Any suggestions?

https://redd.it/1uol9jr
@r_rust
Frame - Aesthetic FFmpeg GUI
https://redd.it/1uoqvof
@r_rust
maplike: Traits for abstract containers and operations on them

Hello!

I would like to share my crate, maplike. Maplike provides traits for common operations, .get(), .set(), .insert(), .remove(), .push(), .pop(), .into_iter() etc., over container data structures, such as std's Vec, BTreeMap, BTreeSet, HashMap, HashSet and for multiple third-party types, e.g. stable_vec::StableVec, thunderdome::Arena, tinyvec::ArrayVec, tinyvec::TinyVec.

Link: https://github.com/mikwielgus/maplike

I developed this library for myself to make it possible to write code that is generic over different collection-like data types. These types all have considerable similarities between their interfaces, but I couldn't find a suitable library with traits to abstract the shared behavior that I needed, so I rolled my own.

Basically, this is Python's collections.abc, but in Rust, and with traits not only for different kinds of containers, but also for each operation.

I maintain this library and dogfood it in my other two crates:

undoredo \- Undo/Redo and non-linear history tree using sparse deltas (diffs), snapshots, or commands on arbitrary data structures.

dcel \- half-edge data structure that is generic over its containers.

Feedback is welcome!

Below are two code examples taken from the readme:

First example. Function that gets the second element of a collection that is generic over `Vec`, array, `BTreeMap`:

use std::collections::BTreeMap;

use maplike::Get;

// Generic over any collection implementing the Get trait.
fn getsecondelement<C: Get<usize>>(collection: &C) -> Option<&C::Value> {
collection.get(&1)
}

// get_second_element() works for Vecs, arrays, and maps with the very
// same code.
asserteq!(getsecondelement(&vec![10, 20, 30]), Some(&20));
assert
eq!(getsecondelement(&10, 20, 30), Some(&20));
asserteq!(getsecondelement(&BTreeMap::from([(0, 10), (1, 20)])), Some(&20));use std::collections::BTreeMap;

Second example. Code that is generic over \`Vec\`, \`tinyvec::ArrayVec\`, \`tinyvec::TinyVec\`:

use maplike::{Clear, Push, Veclike};
use tinyvec::{ArrayVec, TinyVec};

// This function is generic over any `Veclike` collection. The `Veclike` bound
// provides `.clear()`, `.push()` and many other methods at once.
fn replace
all<C: Veclike<usize, Value = i32>>(collection: &mut C, values: &i32) {
collection.clear();
for &value in values {
collection.push(value);
}
}

// replace_all() now works for any Veclike collection.

// Works on Vec,
let mut vec = Vec::new();
replaceall(&mut vec, &[1, 2, 3]);
assert
eq!(vec, 1, 2, 3);
replaceall(&mut vec, &[4, 5, 6]);
assert
eq!(vec, 4, 5, 6);

// Works on tinyvec::ArrayVec.
let mut arrayvec: ArrayVec<[i32; 8]> = ArrayVec::new();
replace
all(&mut arrayvec, &[7, 8, 9]);
assert
eq!(arrayvec.asslice(), 7, 8, 9);

// Works on tinyvec::TinyVec.
let mut tinyvec: TinyVec<[i32; 8]> = TinyVec::new();
replace
all(&mut tinyvec, &[10, 11, 12]);
assert
eq!(tinyvec.asslice(), 10, 11, 12);use maplike::{Clear, Push, Veclike};

https://redd.it/1uoqccw
@r_rust
Is rust a complete web dev language?

Recently found out that rust can be used to write frontend as well as the backend. How is the state of the frontend in rust compared to JavaScript frameworks like react or vue? Is it practical to use for production apps? Is there big community supporting rust frontend?

https://redd.it/1uottji
@r_rust
Hey Rustaceans! Got a question? Ask here (28/2026)!

Mystified about strings? Borrow checker has you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet. Please note that if you include code examples to e.g. show a compiler error or surprising result, linking a playground with the code will improve your chances of getting help quickly.

If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so ahaving your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.

Here are some other venues where help may be found:

/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.

The official Rust user forums: https://users.rust-lang.org/.

The unofficial Rust community Discord: https://bit.ly/rust-community

Also check out last week's thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.

Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.

https://redd.it/1uox0x9
@r_rust
Compiling Rust to JVM is now ~36x faster after a rewrite of stack map generation and more refactors to rustc_codegen_jvm! (context, repo links and script to reproduce in comments!)
https://redd.it/1uowc3f
@r_rust