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

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

Expand description

Rust 的 “try catch” 构造使用数据指针 data 调用函数指针 try_fn

第三个参数是如果发生 panic 则调用的函数。 此函数采用数据指针和指向所捕获的特定于目标的异常对象的指针。

有关更多信息,请参见编译器的源代码以及 std 的 catch 实现。