operator ~ method

  1. @override
Error operator ~()
override

Returns the inner Value from COk or Error from CErr Convinient operator to get the inner value from the CResult, Usage:

final res = CResult<int, String>.from(1);
int val = ~res;
assert(val == 1);

final res = CResult<int, String>.from('error');
String err = ~res;
assert(err == 'error');

Implementation

@override
Error operator ~() => error;