I want to parse a Table into struct Event using try_into() function which should work fine, according to the documentation. However, the compiler didn't seem to understand my intention and appeared to think the reference in the following code is this try_into().
error[E0277]: the trait bound `Event: From<toml::map::Map<std::string::String, Value>>` is not satisfied
--> src/lib.rs:10:5
|
10 | table.try_into().unwrap()
| ^^^^^ -------- required by a bound introduced by this call
| |
| the trait `From<toml::map::Map<std::string::String, Value>>` is not implemented for `Event`
|
= note: required for `toml::map::Map<std::string::String, Value>` to implement `Into<Event>`
= note: required for `Event` to implement `TryFrom<toml::map::Map<std::string::String, Value>>`
= note: required for `toml::map::Map<std::string::String, Value>` to implement `TryInto<Event>`
% cargo test
Compiling asdf v0.1.0 (/home/rust/asdf)
error[E0277]: the trait bound `Event: From<toml::map::Map<std::string::String, Value>>` is not satisfied
--> src/main.rs:9:11
|
9 | table.try_into().unwrap()
| ^^^^^^^^ the trait `From<toml::map::Map<std::string::String, Value>>` is not implemented for `Event`
|
= note: required because of the requirements on the impl of `Into<Event>` for `toml::map::Map<std::string::String, Value>`
= note: required because of the requirements on the impl of `TryFrom<toml::map::Map<std::string::String, Value>>` for `Event`
= note: required because of the requirements on the impl of `TryInto<Event>` for `toml::map::Map<std::string::String, Value>`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `asdf` due to previous error