trait Foo { type Item; fn foo(&self) -> Self::Item; } struct Bar; ... Rust 內建了很多的trait ,只要實作了這些trait 就能讓Rust 知道你的型態能提供哪些功能,也 ...
確定! 回上一頁