我是个新手,希望能像这样在我的结构中实现我的hashmap
#[derive(Clone, Data)]
struct CheckState {
cool: String,
int_cool: i32,
hashmap_cool: HashMap<i32, String>
}
但我一直收到错误代码
error[E0277]: the trait bound `HashMap<i32, std::string::String>: Data` is not satisfied
我不明白为什么,而且帮助也不多
铁锈有助于
help: the following other types implement trait `Data`:
&'static str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
(T0, T1, T2, T3, T4, T5)
(T0,)
and 87 others
= note: this error originates in the derive macro `Data` (in Nightly builds, run with -Z macro-backtrace for more info)
请忽略变量名,它们在我的代码中不一样