You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OK/KO type to be used as return type of extern(C) functions
Adding this should be a great opportunity to add some doc on a good pattern for error handling on a C API. (ie if the result was KO, then call a last_error function to get the actual error)
type definition
wrap function that takes a FnOnce returning a Resutl and returns OK or KO (and set last error in that case)
last_error function to get the last error, that should be exposed in the FFI by the user of the crate
document how to rename the struct in cbindgen. CResult makes a lot of sense in rust but not in C
OK/KOtype to be used as return type ofextern(C)functionsAdding this should be a great opportunity to add some doc on a good pattern for error handling on a C API. (ie if the result was KO, then call a last_error function to get the actual error)
wrapfunction that takes aFnOncereturning a Resutl and returns OK or KO (and set last error in that case)last_errorfunction to get the last error, that should be exposed in the FFI by the user of the crateCResultmakes a lot of sense in rust but not in C