I have a struct where, you can call a function to get a sender or receiver channel, and a spawn function, the spawn spawns a proxy so you when you ask for the receiver it will give you an unbounded receiver, only by…
Pre-RFC: Compile-time conditional branching on trait implementations I'd like to propose a way for generic Rust code to conditionally compile branches depending on whether a type implements a trait. The idea is…
let s = String::from("hello"); let tuple = (s, s.len()); // i am confused how ownership is moving b/w same vars i.e from first s to tuple s if all s are same ,how it's working??? 3 posts - 3 participants Read full topic
I currently have this struct in my code: /// auto flushes on drop struct Flusher<'a, W: AsyncWriteExt + Unpin>(&'a mut W); which I want to use to automatically flush my async file stream instead of manually calling…
I am trying to use phf to create a compile time made hashmap, but this requires that the generic type has a static lifetime. I need to compare against the output of this hashmap, but it isn't working because (in my…
I believe I've already found a workaround by just matching against the finite number of concrete types and passing the syn::type struct into the function manually, but it would be nice not to have to do that. I was…