Class OptionExtensions
- Namespace
- UniOption
- Assembly
- UniOption.dll
public static class OptionExtensions
- Inheritance
-
OptionExtensions
- Inherited Members
Methods
Flatten<T>(ValueOption<ValueOption<T>>)
Flattens a nested ValueOption of ValueOption into a single ValueOption.
public static ValueOption<T> Flatten<T>(this ValueOption<ValueOption<T>> option) where T : struct
Parameters
option
ValueOption<ValueOption<T>>
Returns
- ValueOption<T>
A ValueOption that is the flattened result of the ValueOption of ValueOption.
Type Parameters
T
ToOption<T>(SerializableOption<T>)
Converts the specified Serialized Option into an Option.
public static Option<T> ToOption<T>(this SerializableOption<T> serializableOption) where T : class
Parameters
serializableOption
SerializableOption<T>
Returns
- Option<T>
An Option with the same content.
Type Parameters
T
ToOption<T>(T)
Converts the specified reference type content to an Option.
public static Option<T> ToOption<T>(this T content) where T : class
Parameters
content
T
Returns
- Option<T>
An Option with the specified content.
Type Parameters
T
ToValueOption<T>(T?)
Converts the nullable value type content to a ValueOption.
public static ValueOption<T> ToValueOption<T>(this T? content) where T : struct
Parameters
content
T?
Returns
- ValueOption<T>
A ValueOption with the specified content if it has a value; otherwise, a ValueOption with a None value.
Type Parameters
T
ToValueOption<T>(T)
Converts the specified value type content to a ValueOption.
public static ValueOption<T> ToValueOption<T>(this T content) where T : struct
Parameters
content
T
Returns
- ValueOption<T>
A ValueOption with the specified content.
Type Parameters
T