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…
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…
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…
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…
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 '.'.…
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={}…
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…
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…
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>…
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…