[英]How can I get a list of types that implement a particular trait in Rust?
I want to know a struct that implements std::io::Write
; 我想知道一个实现
std::io::Write
; is it described in some document? 它是在某些文件中描述的吗?
When you lookup the API for std
you can search for your trait there (eg std::io::Write
). 当您查找
std
的API时,您可以在那里搜索您的特征(例如std::io::Write
)。
When you scroll down to the section " Implementors " you will see all structs/enums that implement that trait in std
. 当您向下滚动到“ 实现者 ”部分时,您将看到在
std
中实现该特征的所有结构/枚举。
To get a better overview, you can use the + or - keys to collapse all sections and have a nice overview, eg 为了获得更好的概述,您可以使用+或-键折叠所有部分并获得一个很好的概述,例如
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.