简体   繁体   English

如何获得在Rust中实现特定特征的类型列表?

[英]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 ). 当您查找stdAPI时,您可以在那里搜索您的特征(例如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.

相关问题 如何在 Rust 的内部特征上实现外部特征? - how can I implement an external trait on an internal trait in Rust? 如何实现Rust的Copy特性? - How can I implement Rust's Copy trait? rust 实现多种类型的特征 - rust implement trait for multiple types 如何在特征中使用枚举并在枚举中的结构上实现特征? Rust - How can I use enum in a trait and implement trait on structs that are in the enum? Rust 如果两个特征都是为引用实现的,那么如何为实现特征A的所有类型实现特征B? - How can I implement trait B for all types that implement trait A if both traits are implemented for references? 如何为实现特征的所有类型实现From特质,但对某些类型使用特定的实现? - How can I implement the From trait for all types implementing a trait but use a specific implementation for certain types? 如何为实现该特征的现有类型的枚举实现范围内的特征? - How can I implement a trait in scope for an enum of existing types for which the trait is implemented? 我可以实现一个将信息添加到Rust中的外部类型的特征吗? - Can I implement a trait which adds information to an external type in Rust? 我如何使用 @ 字符作为 Rust 装饰器来实现结构的特征? - how could i use @ character as a Rust decorator to implement trait to a struct? 如何为实现特定特征的所有类型批量实现反序列化? - How can I mass implement Deserialize for all types that implement a specific trait?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM