1 unstable release
0.1.0 | Feb 22, 2024 |
---|
#33 in #statically
3KB
An option type that is always Some
or None
, depending on a static type parameter.
Example
use static_option::*;
enum Inner<Selector: StaticOptionSelector> {
A(StaticOption<Selector, i32>),
B(StaticOption<Selector, u32>),
}
enum MaybeInitialised {
Initialised(Inner<StaticOptionSome>),
Uninitialised(Inner<StaticOptionNone>),
}