Returns the error if it is CErr or throws an error if it is COk
Convinient operator to get the error from the result,
user should ensure that the result is CErr, otherwise it will throw an UnimplementedError
Usage:
final res = CResult<int, String>.from('error');
final err = res / 0;
assert(err == 'error');
Returns the value if it is COk or throws an error if it is CErr
Convinient operator to get the value from the result,
user should ensure that the result is COk, otherwise it will throw an UnimplementedError
Usage:
final res = CResult<int, String>.from(1);
final val = res | 0;
assert(val == 1);