Expand description
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>),
}
Structs§
- Static
Option None - Type indicating that a static option is
None. - Static
Option Some - Type indicating that a static option is
Some.
Traits§
- Static
Option Selector - A static option selector for
SomeorNone. It is sealed and only implemented byStaticOptionSomeandStaticOptionNone.
Type Aliases§
- Static
Option - The static option type.
Selectoris eitherStaticOptionSomeorStaticOptionNone.Typeis the inner type of the option, likeOption<Type>in the standard library.