unwrap method

T unwrap()

Unwraps the result, throwing if it contains an error.

Implementation

T unwrap() {
  final self = this;
  if (self is Ok<T, E>) return self.value;
  throw StateError('Tried to unwrap Err: ${(self as Err<T, E>).error}');
}