One thing that I am genuinely interested in rust, If same thing that I can generally do in Java building enterprise grade system, I can do in Rust. Not a secrete Java and OOP become de-factor a standard for every enterprise solution. And my step…
This is design that became de-facto standard for every enterprise solution. How would you design this in rust? language = java interface Collection { int size(); // Iterator does only one thing, iterate. // Question about clean, please do not use…
I had it working without passing parameters but now I get an expected function pointer, found function item error. Code Snippet: Creating the menu and the function it's storing fn create_menu() -> Menu { let mut menu = Menu::new("Main…
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 adding the coorosponding…
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 superficially similar to instanceof in…
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 flush. However Drop doesn't…
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 understanding) they are no longer…
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 wondering if anyone knew of a way…
This is an attempt to re-design the Try and Residual traits to be simpler while generally maintaining functionality. I call it "fat try" because it stuffs most everything into Try instead of breaking it up into several traits. I believe this is…
Hi. I've tried xcode reinstalling, downgrading mac sdk to try and fix this cc linkage issue among other solutions online but none seem to work. error: linking with cc failed: exit status: 1 | = note: "cc" "/Users/User/Documents/prog/rust_test/target/…
A better explanation is here: Rotate super-imposed images over each other - #4 by canina I have to use async to rotate two images over each other translucently. When trying myself I assumed I needed a big function like. async fn…