ic-canister-kit 1.0.32

An ic canister package
Documentation
1
2
3
4
5
6
7
8
9
10
11
/// 拆箱
/// ! 可能中止程序
pub fn trap<T, E>(result: Result<T, E>) -> T
where
    E: Into<String>,
{
    match result {
        Ok(value) => value,
        Err(err) => ic_cdk::trap(&err.into()),
    }
}