toOption method

Option<T> toOption()

Returns Some if the value is not null, otherwise None

Implementation

Option<T> toOption() => this != null ? Some<T>(this as T) : None<T>();