decode method
Implementation
@override
Result<R, E> decode(Input input) {
final index = input.read();
switch (index) {
case 0:
return Result.ok(okCodec.decode(input));
case 1:
return Result.err(errCodec.decode(input));
default:
throw Exception('Invalid index for Result: $index');
}
}