简体   繁体   中英

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 ; is it described in some document?

When you lookup the API for std you can search for your trait there (eg std::io::Write ).

When you scroll down to the section " Implementors " you will see all structs/enums that implement that trait in std .

To get a better overview, you can use the + or - keys to collapse all sections and have a nice overview, eg

编写实现者概述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM