Objective-C methods generally return errors via NSError, but it's not so standardized across the C-like functions, those usually return an integer that you have to test against. For example:
pub fn CGDisplayCapture(display: CGDirectDisplayID) -> CGError { ... }
It'd be nice if we could make this return something like Result<(), CGError> instead, with the "success" case already checked.
Types we'd want to handle:
CGError
CFSocketError
OSStatus
CVReturn
kern_return_t
- ... probably more?
Objective-C methods generally return errors via
NSError, but it's not so standardized across the C-like functions, those usually return an integer that you have to test against. For example:It'd be nice if we could make this return something like
Result<(), CGError>instead, with the "success" case already checked.Types we'd want to handle:
CGErrorCFSocketErrorOSStatusCVReturnkern_return_t