:nerd_face: There is no special declaration called type
:nerd_face: None is no valued struct i.e. kind of Nil
:nerd_face: Some is a single valued struct
:nerd_face: value constructor
enum Option<T> {
None,
Some(T),
}
Some is a variant or a value constructor for the Option type
You can think of it as a function with the type fn<T>(value: T) -> Option<T>
Correspondingly, None is also a value constructor, except it has no arguments.
You can think of None as a function with the type fn<T>() -> Option<T>
:nerd_face: There is no special declaration called
type
:nerd_face:None
is no valued struct i.e. kind ofNil
:nerd_face:Some
is a single valued struct :nerd_face: value constructorfn<T>(value: T) -> Option<T>
type fn<T>() -> Option<T>