3 ms·
> The article then goes on to say that this is impossible in Rust, which is probably a fair statement. You may be able to get something quite close with really
by LegionMammal978 4y ago
> The article then goes on to say that this is impossible in Rust, which is probably a fair statement. You may be able to get something quite close with really horrible, unsafe code but no sane person would try.
As it happens, a crate was just released that does exactly this, using a derive macro [0]. (I wouldn't recommend using it quite yet, though; it still has a few kinks to be worked out.)
[0] https://crates.io/crates/peapod https://crates.io/crates/peapod
- pcwalton 4y agoYeah, in general macros allow for Rust to do these things just fine. I wouldn't say that it's a fair statement at all.