Return type notation MVP: Call for testing! | Inside Rust Blog (blog.rust-lang.org)
from u_1f914@lemmy.world to rust@programming.dev on 26 Sep 23:25
https://lemmy.world/post/20224906

#rust

threaded - newest

0x01@lemmy.ml on 27 Sep 01:49 next collapse

The real example of a health check trait really brings this issue to life, it’s linked within op’s article as well

Is this a reasonable summary?

Say you want a trait where a method returns a task that you would like to sometimes run within your own thread and sometimes move it to a separate thread to be executed, that means the Send constraint isn’t necessary to add to your trait but it would be nice to add that constraint within another method’s parameter definition so that it can accept structs that implement the trait and further constrain that implementation to be Send’able. That’s now possible with this new rust language feature, though it was previously possible through a crate, now it’s no longer needed.

ExperimentalGuy@programming.dev on 01 Oct 17:42 collapse

Is anyone actually going to go and check what they asked for? I feel like I understood what they asked but still don’t know where to start if I were to try.