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

docs: update for 3d deserialization #26

Merged
merged 1 commit into from
Oct 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/serde.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
//! # `serde` support
//!
//! Support is somewhat limited, only 2D point types are available at the moment.
//! Support is limited to 2D and 3D point types are available at the moment.
//!
//! This will eagerly parse any map-like object with an `x` and `y` property that
//! holds a deserialize-able number type, even if other keys may be present in the map.
//! This will eagerly parse any map-like object with an `x` and `y` property
//! (and a `z` property for 3D points) that holds a deserialize-able number type,
//! even if other keys may be present in the map.
//!
//! Much of this implementation was designed around JSON input data. If assumptions made by that don't hold for
//! your particular input and this fails when it shouldn't, open an issue.
//! Much of this implementation was designed around JSON input data. If
//! assumptions made by that don't hold for your particular input and this fails
//! when it shouldn't, open an issue.
//!
//! ## Example (JSON)
//!
Expand All @@ -18,6 +20,9 @@
//!
//! let point_json = r#"{ "x": 5, "y": 5 }"#;
//! let point: Point<2, f64> = serde_json::from_str(point_json).unwrap();
//!
//! let point3d_json = r#"{ "x": 5, "y": 5, "z": 5 }"#;
//! let point3d: Point<3, f64> = serde_json::from_str(point3d_json).unwrap();
//! ```

use crate::{ExtendedNumOps, Point};
Expand Down
Loading