I’m searching for a crate offering something like this:
pub struct NoneType; pub struct SomeType<T>(pub T);
Recently, I’m doing a lot of work that involves type level magic. And several times already, I needed to express the notion of an optional type. Sure, you could just use
NoneType, but that doesn’t always work and is not really nice.
So since I needed that a few times already, I would like to use a crate for it. Is there a crate offering this? If not, I would write my own. (Of course, the crate could offer more than those two lines of code. I’m sure one could write many of
Option<T>'s methods on type level.)
I tried to search via crates.io and Google, but it’s… not easy since “option” is such a common word around Rust.