小编Jua*_*ant的帖子

`diesel_geography::types::GeogPoint` 没有实现 `serde::Deserialize<'_>` 特征

我正在尝试使用 Diesel 和diesel_geography 使用 Rust 从 PostGIS 数据库中读取数据。

这是我收到的错误:

error[E0277]: the trait bound `diesel_geography::types::GeogPoint: serde::Serialize` is not satisfied
  --> src/models.rs:11:5
   |
11 |     pub coordinates: GeogPoint,
   |     ^^^ the trait `serde::Serialize` is not implemented for `diesel_geography::types::GeogPoint`
   |
   = note: required by `serde::ser::SerializeStruct::serialize_field`

error[E0277]: the trait bound `diesel_geography::types::GeogPoint: serde::Deserialize<'_>` is not satisfied
  --> src/models.rs:11:5
   |
11 |     pub coordinates: GeogPoint,
   |     ^^^ the trait `serde::Deserialize<'_>` is not implemented for `diesel_geography::types::GeogPoint`
   |
   = note: required by `serde::de::SeqAccess::next_element`

error[E0277]: the trait bound `diesel_geography::types::GeogPoint: …
Run Code Online (Sandbox Code Playgroud)

postgis rust rust-diesel serde

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

标签 统计

postgis ×1

rust ×1

rust-diesel ×1

serde ×1