trait 為Rust 語言特徵,告知Rust compiler 一個型別必須滿足的功能性。 回想一下使用方法語法 呼叫函式時用過的 impl ... 現在型別 T 需要 Clone 和 Debug traits。
確定! 回上一頁