更新时间:2023-12-05 13:34:22
一篇关于它.要为您的错误获得一流的支持,您需要做两件事:
There's an excellent post about it. To get first-class support for your error you need to do two things:
Error
trait 适合您的类型.?
运算符(quick_error crate 有助于自动执行此操作.Error
trait for your type.std::convert::From
for error types you want to use seamlessly with the ?
operator (the quick_error crate helps automate this).