Skip to content
TILens What matters today in tech v0.4.0
Theme
Topics - Rust
Calendar · NOV 2026
‹ Nov 2026 ›
  1. JAN
  2. FEB
  3. MAR
  1. APR
  2. MAY
  3. JUN
  1. JUL
  2. AUG
  3. SEP
  1. OCT
  2. NOV
  3. DEC
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Favorites (0)

Community stream

Community

Reducing duplication in `TryFrom`

Hey folks, I've got the following duplication: impl TryFrom<Reader<&[u8]>> for DictionaryStemmer { type Error = Error; fn try_from(mut reader: Reader<&[u8]>) -> Result<Self, Self::Error> { let mut term_stems: HashMap<String, String> =…

rust-users-forum

Generic statics within generic functions

First off, please forgive my ignorance towards the current implementation and limitations of the compiler. The following may or may not be reasonably feasible. I'm not currently advocating for global generic statics as that can be tricky to…

rust-internals

API design: `TracingResult`

So I've finally had enough of typing .map_err(|error| { tracing::warn!("uncooperative yak!", %error); error })?; and decided to do something about it. I currently have the following (nightly only), but would really like ideas and challenges on the…

rust-users-forum

How to transmit a D-Bus message with the exact same body?

I'm working on a dbus project where I need to be able to transmit dbus method calls. The idea is: I receive a dbus method call I change the source and destination in order to transmit the message to another object (based on internal logic) The…

rust-users-forum

Need help about AI

Hey everyone! I’m curious about how other Rust developers are actually using AI in their day-to-day development. I’m currently trying to improve my own workflow and would really appreciate hearing how you approach things in practice, especially: AI…

rust-users-forum

Failing to read a file due to it not being valid UTF-8

This is some code I wrote (src/main.rs): let contents = fs::read_to_string("test.bf").unwrap(); however, when it runs, it panics due to the file not being valid UTF-8 despite the file being UTF-8 encoded. The character it claims is not valid is '.'.…

rust-users-forum

List types of a struct

Hello, Do you know a crate that is able to do this below ? (I saw memoffset can partially do it, and type-layoutjust display all the list) #[repr(C)] struct MyStruct { var1: u8, var2:i64 } for var_info in magic_macro!(MyStruct) { println!("Name={}…

rust-users-forum

Finding the origin of a Result::Err

Somewhere deep inside a deserialization library I'm using, something returns a Result::Err with a very non-helpful error message. It gets passed on through several layers, some of them macro-generated. When I try to .unwrap() it, I get the location…

rust-users-forum

New User Tutorial

I am a new user to the Rust community. How to start the new user tutorial 2 posts - 1 participant Read full topic

rust-users-forum

New to Rust, converting a project from Python

Hi All, I'm new to Rust, coming from a systems engineering and Python background, with the idea of learning Rust for AI tooling and safe agent runtimes. To help get more fluent, I want to start converting some of my Python projects to Rust. I figure…

rust-users-forum

Why the `unreachable!()` can't be optimized away?

type Arg = Vec<u8>; #[unsafe(no_mangle)] fn test(this: &mut Option<Arg>, arg: Arg) { *this = Some(arg); let Some(arg) = this else { unreachable!() }; black_box(arg); } With rust v1.98.0, its assembly: test: pushq %r14 pushq %rbx pushq %rax movq…

rust-users-forum

What's wrong with this line and why?

fn main() { let name = String::from("hello"); let (name, len) = calc_len(name); println!("{name} : {len}"); } fn calc_len(name:String)->(String,usize) { (name,name.len()) // this one ???? } 7 posts - 5 participants Read full topic

rust-users-forum

Illegal impl block

Can anyone explain why this impl is not allowed? I am trying to make it so I can call functions on my arrays and not have to iterate over it to call functions on the elements of the array. type Bufs<const N: usize> = [Buf; N]; impl<const N: usize>…

rust-users-forum

Avoiding repeated match when dispatching a unit variants enum to types

I’m looking for feedback on a pattern for doing type-based dispatch from a fieldless enum. The situation is roughly this: #[derive(Clone, Copy)] enum MyEnum { VarA, VarB, } struct VarA; struct VarB; trait MyVarTrait { fn do_trait() {} } impl…

rust-users-forum

444 items available