Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reading and writing Point, LineString etc. directly #10

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

cgrenz
Copy link

@cgrenz cgrenz commented Mar 31, 2022

This splits WKBAbleExt into two new traits WKBSerializable and WKBUnserializable, implements WKBAbleExt for every type implementing both traits, and implements the new traits for Geometry, Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection.

With this all supported geometries can be read and written, even when not wrapped in a Geometry enum.

Additionally it adds ?Sized on all Write bounds. With this unsized writers are fully supported, without resorting to &mut &mut R as previously used in write_geom_to_wkb (mut result: &mut W combined with &mut result).

@amandasaurus
Copy link
Owner

oh that looks useful. I have learned a lot about how to writte better Rust since I created this library. I made many beginner mistakes.

Shouldn't we call it Desearalize rather than Unserealize, to be like serde?

@cgrenz
Copy link
Author

cgrenz commented Apr 2, 2022

Yeah, you're right, Deserialize is definitely better. I renamed the trait.

@cgrenz
Copy link
Author

cgrenz commented May 15, 2022

@amandasaurus do you think you can merge this now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants