Module objc2::exception[][src]

Expand description

Objective-C’s @throw and @try/@catch.

By default, if the msg_send! macro causes an exception to be thrown, this will unwind into Rust, resulting in undefined behavior. However, this crate has an "catch_all" feature which, when enabled, wraps each msg_send! in a catch and panics if an exception is caught, preventing Objective-C from unwinding into Rust.

This module is only available when the "exception" feature is enabled.

See the following links for more information:

Functions

Tries to execute the given closure and catches an Objective-C exception if one is thrown.

Throws an Objective-C exception.