https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8b39f6ec9bd456ed5bbaa48fcbd1c461
^ sort of the outline of what I'm trying to make
I know you cant just go "A as B" with generic types- the as operator doesn't support it. So instead I've found num::cast::AsPrimitive which seems to do the same thing, but as a trait. But I can't for the life of me figure out how to make it work- the trait bounds or whatever it is don't make any sense to me. (might be a problem with the trait?)
to preempt anyone asking about what this is for / x-y problem- this trait is going to be part of a bitfield crate/macro I'm working on
A browser interface to the Rust compiler to experiment with the language