是问号运算符吗?相当于尝试!宏? [英] Is the question mark operator ? equivalent to the try! macro?

查看:81
本文介绍了是问号运算符吗?相当于尝试!宏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法来链接Rust中try!宏的用法,并发现

I am looking for a way to chain the usage of the try! macro in Rust and found this pull request that implements the ? operator.

似乎已经合并了,但是我似乎还没有找到任何文档.它等于try!宏还是有重要区别?

It seems like it has been merged, but I cannot seem to find any documentation on it yet. Is it equivalent to the try! macro or are there important differences?

推荐答案

是的,?运算符等效于try!(). ?现在处于稳定的Rust 1.13,发布于11月10日, 2016 .

Yes, the ? operator is equivalent to try!(). ? is now in stable Rust 1.13, released on November 10, 2016.

目前最好的文档来源似乎是问题).

The best source of documentation at the moment seems to be RFC 0243. Note that the catch described in the RFC is not yet implemented at this writing (issue).

这篇关于是问号运算符吗?相当于尝试!宏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆