原书出处
Rust编程之道
09 构建健壮的程序 9.4 恐慌(Panic)
关于Unsafe Rust更详细的介绍。
Rust也提供了catch_unwind方法来让开发者捕获恐慌,恢复当前线程。Rust团队在引入 catch_unwind 方法时考虑了很多关于内存安全的问题,所以该方法只针对那些实现了UnwindSafe的类型。
这样做其实是为了避免开发者滥用catch
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Rust编程之道/_epub-src/text/part0015_split_004.html
EPUB SHA-256:585074c6844ba06a529a7623f659130564e9907ec38a9d661f661974f9787ac8