Rust Result Error Type. Recall from Handling Potential Failure with the Result Type in Chapter 2 that the Result enum is defined as having two variants Ok and Err as follows. Radtke III on 12 Sep 2016.
So heres my attempt at writing a Result type in C. There is still much to do PRs to be merged and other patterns to be included but its a really nice resource already. Thanks for contributing an answer to Stack Overflow.
Just like Option the Result type also has an unwrap method defined in the standard library.
So heres my attempt at writing a Result type in C. The Result type is a way of representing one of two possible outcomes in a computation. Please be sure to answer the questionProvide details and share your research. It uses the Result enum which is a part of the Rust standard library and is used to represent either success Ok or failure Err.