Skip to content

Commit

Permalink
fix(docs): update for 3d deserialization (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
kade-robertson authored Oct 15, 2023
1 parent e9d67eb commit 6c8c464
Showing 1 changed file with 10 additions and 5 deletions.
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

0 comments on commit 6c8c464

Please sign in to comment.