georust / geozero

Zero-Copy reading and writing of geospatial data.
Apache License 2.0
323 stars 30 forks source link

Docs: Add example how to use with Serde #110

Open tobias47n9e opened 1 year ago

tobias47n9e commented 1 year ago

I have a struct that uses:

#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Item {
    pub id: i32,
    pub coordinates: Option<Decode<geo_types::Geometry<f64>>>,

The #[derive(Seralize)] produces the following error:

the trait Serialize is not implemented for geozero::wkb::Decode<geo_types::Geometry>

Would it be possible to add an example to the docs showing hot to serialize a struct fetched with sqlx using Serde?

sergiomeneses commented 4 months ago

Any news about this?