I was wondering if it is possible to decode a JSON object in Rust that has an attribute name which is also a Rust keyword. I am working with the rustc-serialize crate and my struct definition looks like this:
#[derive(RustcDecodable)]
struct MyObj {
type: String
}
The compiler throws an error because type is a keyword:
error: expected identifier, found keyword `type`
src/mysrc.rs:23 type: String,
^~~~
impl Decodableis the only way?Json::from_strand then poking into its result value.