I want trait implementations in Rust to be able to return arbitrary iterators (of specific item type) that may reference the original object with a lifetime 'a
I often want to compile in release mode with debug = true so that I can read the generated assembly a bit easier. I am currently doing this: [profile.release]
Is there a way to extract the number of elements in an enum? Simple example (with imaginary number_of_elements method): enum FooBar { A = 0, B, C, }; println
MCVE (simplified from real code where I may return a raw vec.iter(), or a vec.iter().filter() based on some conditions): let input = vec![1,2,3]; let dyn_iter:
I’m just starting a Rust project and already it takes ~7.6s to build what I’d consider a simple binary. I’m using async/await a lot and comme
I am implementing gRPC client and server using Tonic. I have two modules each module depending on another module proto file. I am facing an issue when I try to
I am setting some breakpoints in some async threaded code and I can't seem to figure out how to tell visual studio code to catch any threads in this code path.
My program, when started up with the system, is unable to access a networked location: fn main() { ensure_network("\\\\SERVER\\".to_string()); } fn ensure_
I'm trying to invert a HashMap<String, MyEnum> in Rust, and getting an error: Rust Playground instance Code: use std::collections::HashMap; // Directive
The following command $ cargo build produces a non-optimized build with debugging information. On the contrary, $ cargo build --release produces an optimi
I want to find files for some pattern with multiple extensions. Ex:- some/path/**.{json,jsonc} But rust glob function is not working with these types of patt
How do I output colored text to the terminal using Rust? I've tried using the special escape characters that I found in this python answer, but they just print
I seem to have diverging versions of rustc and cargo (I think), $ rustc -V rustc 1.9.0 (e4e8b6668 2016-05-18) $ cargo -V cargo 0.10.0-nightly (10ddd7d 2016-04
I'm writing for a program that hooks into a web service which sends back JSON. When a certain property isn't there it provides a empty object, with all its fie
Rust's chrono::Local contains the local timezone information but does not seem to have any methods to get the value as a string or a number of seconds offset.
I would like to run a function with lots of different variables Let assume my function is : async fn do_the_hard_job(my_input: u16) { ... // do the hard
ORIGINAL QUESTION: I am currently trying to write a library in rust - to be compiled to WASM - for converting a bip39 mnemonic passphrase into an Arweave JWK. I
I am currently learning Rust, and for that purpose I wanted to create my own crate and use it. However, Rust can't find this crate. I have the following file st
I'm trying to teach myself Rust by working on a little calendar project. Here I'm trying to generate a list of dates spanning three whole months around a given
I have the following code which uses both Rc and Box; what is the difference between those? Which one is better? use std::rc::Rc; fn main() { let a = Box::