objc-rs 0.3.0

Objective-C Runtime bindings and wrapper for Rust. Maintained fork of objc crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use objc_exception;

use crate::rc::StrongPtr;
use crate::runtime::Object;

pub unsafe fn r#try<F, R>(closure: F) -> Result<R, StrongPtr>
where
    F: FnOnce() -> R,
{
    unsafe {
        objc_exception::r#try(closure).map_err(|exception| StrongPtr::new(exception as *mut Object))
    }
}