title: the trait `serde::Deserialize<'_>` is not implemented for `diesel_geography::types::GeogPoint`
body: <p>I'm trying to use Diesel and diesel_geography to read from a PostGIS database using Rust.</p>
  
  <p>Here's the error I'm getting:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0277]: the trait bound `diesel_geography::types::GeogPoint: serde::Serialize` is not satisfied
    --&gt; 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&lt;'_&gt;` is not satisfied
    --&gt; src/models.rs:11:5
     |
  11 |     pub coordinates: GeogPoint,
     |     ^^^ the trait `serde::Deserialize&lt;'_&gt;` 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: serde::Deserialize&lt;'_&gt;` is not satisfied
    --&gt; src/models.rs:11:5
     |
  11 |     pub coordinates: GeogPoint,
     |     ^^^ the trait `serde::Deserialize&lt;'_&gt;` is not implemented for `diesel_geography::types::GeogPoint`
     |
     = note: required by `serde::de::MapAccess::next_value`
  </code></pre>
  
  <p>Looking around, I found that a similar error happens when there are several versions of <code>serde</code> used as dependency, this can be checked using <code>cargo tree -d</code>. I've tried and <code>serde</code> does not appear as a duplicate dependency.</p>
  
  <p>This is my code so far:</p>
  
  <p>Cargo.toml</p>
  
  <pre><code>[package]
  name = "123"
  version = "0.1.0"
  authors = ["ASD"]
  edition = "2018"
  
  [dependencies]
  diesel = { version = "1.4.2", features = ["postgres"] }
  serde = { version = "1.0", features = ["derive"] } 
  serde_json="1.0"
  
  dotenv = "0.14.1"
  
  diesel-geography = "0.2.0"
  </code></pre>
  
  <p>schema.rs</p>
  
  <pre><code>table! {
      use diesel::sql_types::*;
      use diesel_geography::sql_types::*;
  
      users (email) {
          email -&gt; Varchar,
          password -&gt; Varchar,
          coordinates -&gt; Geography
      }
  }
  </code></pre>
  
  <p>models.rs</p>
  
  <pre><code>use diesel_geography::types::*;
  use crate::schema::users;
  use serde::{Serialize, Deserialize};
  
  #[derive(Debug, Serialize, Deserialize, Queryable, Insertable)]
  #[table_name = "users"]
  pub struct User {
      pub email: String,
      pub password: String,
      pub coordinates: GeogPoint
  }
  </code></pre>
  
  <p>main.rs</p>
  
  <pre><code>extern crate serde;
  extern crate dotenv;
  #[macro_use] extern crate diesel;
  //#[macro_use] extern crate serde_derive;
  
  mod models;
  mod schema;
  use diesel::PgConnection;
  use dotenv::dotenv;
  use std::env;
  
  use diesel::prelude::*;
  
  fn main() {
      dotenv().ok();
  
      let database_url = env::var("DATABASE_URL")
          .expect("DATABASE_URL must be set");
  
      let connection = PgConnection::establish(&amp;database_url)
          .expect(&amp;format!("Error connecting to {}", database_url));
  
      use crate::schema::users::dsl::*;
      use crate::models::User;
  
      let results = users
          .limit(5)
          .load::&lt;User&gt;(&amp;connection)
          .expect("Error loading users");
  
      println!("Displaying {} users", results.len());
  
      for user in results {
          println!("{}", user.email);
          println!("----------\n");
          println!("{}", user.password);
      }
  }
  </code></pre>