Struct Option<T>
Option type implementation. Option type.
public readonly struct Option<T>
Type Parameters
T
Value type.
- Inherited Members
- Extension Methods
Fields
None
Gets None value for option.
public static readonly Option<T> None
Field Value
- Option<T>
Properties
HasValue
Returns true
if current option stores some value instead of None.
public bool HasValue { get; }
Property Value
Value
Gets value, stored in option.
public T Value { get; }
Property Value
- T
Methods
Some(T)
Creates option with value.
public static Option<T> Some(T value)
Parameters
value
TOption's value.
Returns
- Option<T>
Option instance.
Operators
implicit operator Option<T>(T)
public static implicit operator Option<T>(T value)
Parameters
value
T
Returns
- Option<T>