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
Some
orNone
. It is sealed and only implemented byStaticOptionSome
andStaticOptionNone
.
Type Aliases§
- Static
Option - The static option type.
Selector
is eitherStaticOptionSome
orStaticOptionNone
.Type
is the inner type of the option, likeOption<Type>
in the standard library.