列出范围内类型实现的所有特征 [英] List all traits implemented by a type in a scope
本文介绍了列出范围内类型实现的所有特征的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为了使调试更容易等,我想知道为特定范围内的类型实现的所有特征.我可以让 rustc
向我提供这些信息吗?如果是这样,如何?
解决方案
使用rustdoc
/cargo doc
.
rustdoc
创建一个部分,其中包含给定类型的所有特征实现.
如果您想为自己的 crate 执行此操作,您可能会发现 --document-private-items
很有用.另请参阅如何为私人项目生成文档.
For the sake of making debugging easier and such, I would like to know all traits implemented for a type within a certain scope. Can I get rustc
to provide me this information? If so, how?
解决方案
Use rustdoc
/cargo doc
.
rustdoc
creates a section with all trait implementations for a given type. For example with Vec
:
If you would like to do this for your own crate, you might find --document-private-items
to be useful. See also How to generate documentation for private items.
这篇关于列出范围内类型实现的所有特征的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文