setOrOption method

Option<T> setOrOption(
  1. T value
)

Sets the contents of the cell to value. Returns a None if the value is already set. Otherwise returns Some of the input value.

Implementation

Option<T> setOrOption(T value) {
  if (_isSet) {
    return None;
  }
  _val = value;
  _isSet = true;
  return Some(value);
}