NoValue
typeThe absence of a value. This is an enum with no variants, so it is
impossible to create a value of type NoValue
.
enum NoValue {}
This is useful when you have a function that never returns, such as
error()
.
You can also encounter NoValue
on empty containers. For example,
[]
has type List<NoValue>
and None
has type Option<NoValue>
.
This is sometimes called 'the bottom type'.