标签: rust-web3

不满足标准库所需类型的“默认”特征绑定

web3我正在使用板条箱中的类型,web3::contract::Contract<web3::transports::Http>. 编译器抱怨E0277

$ cargo run
   Compiling proj v0.1.0 (/home/user/proj)
error[E0277]: the trait bound `web3::contract::Contract<web3::transports::Http>: Default` is not satisfied
  --> src/book.rs:38:5
   |
38 | /     #[serde(skip)]
39 | |     abi: web3::contract::Contract<OMETransport>,
   | |_______________________________________________^ the trait `Default` is not implemented for `web3::contract::Contract<web3::transports::Http>`
   |
   = note: required by `std::default::Default::default`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `proj`

To learn more, run the command again …
Run Code Online (Sandbox Code Playgroud)

traits type-traits rust rust-web3

1
推荐指数
1
解决办法
600
查看次数

标签 统计

rust ×1

rust-web3 ×1

traits ×1

type-traits ×1