std::intrinsics::try - Rust
Description: API documentation for the Rust `try` fn in crate `std`.
Keywords: rust, rustlang, rust-lang, try

# [−][src]Function std::intrinsics::try

    pub unsafe extern "rust-intrinsic" fn try(
        try_fn: fn(*mut u8),
        data: *mut u8,
        catch_fn: fn(*mut u8, *mut u8)
    ) -> i32

🔬 This is a nightly-only experimental API. (`core_intrinsics`)

intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library

Rust's "try catch" construct which invokes the function pointer `try_fn` with the data pointer `data`.

The third argument is a function called if a panic occurs. This function takes the data pointer and a pointer to the target-specific exception object that was caught. For more information see the compiler's source as well as std's catch implementation.