rustprotocol-buffersserdeprost

How to convert a `serde_json::Value ` to a `prost_types::Struct` in Rust?


fn to_struct(json: serde_json::Value) -> prost_types::Struct {
  // How to implement it?
}

Is there any crate to do it?


Solution

  • https://crates.io/crates/prost-wkt-types can generate prost_wkt_types::Struct, which supports Deserialize trait.