Convert to Option, where Ok becomes Some and Err becomes None.
@pragma('vm:prefer-inline') Option<T> toOption() { if (isOk) { return Some((this as Ok<T, E>).value); } return const None(); }