From 7a86c7ed75b25335ea9c7f90f2abbc65b547a830 Mon Sep 17 00:00:00 2001 From: Ross Lannen Date: Mon, 15 Dec 2025 11:11:18 -0700 Subject: [PATCH] Implement schema for nalgebra point type. --- source/postcard-schema/src/impls/nalgebra_v0_33.rs | 8 ++++++++ source/postcard-schema/src/impls/nalgebra_v0_34.rs | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/source/postcard-schema/src/impls/nalgebra_v0_33.rs b/source/postcard-schema/src/impls/nalgebra_v0_33.rs index e4c71ce8..a860100a 100644 --- a/source/postcard-schema/src/impls/nalgebra_v0_33.rs +++ b/source/postcard-schema/src/impls/nalgebra_v0_33.rs @@ -32,6 +32,14 @@ impl Schema for nalgebra_v0_33::Quaternion::SCHEMA; } +#[cfg_attr(docsrs, doc(cfg(feature = "nalgebra-v0_33")))] +impl Schema for nalgebra_v0_33::Point +where + T: Schema + nalgebra_v0_33::Scalar, +{ + const SCHEMA: &'static NamedType = nalgebra_v0_33::SVector::::SCHEMA; +} + /// Const version of the const-unstable [`<[[T; N]]>::as_flattened()`] const fn flatten(slice: &[[T; N]]) -> &[T] { const { diff --git a/source/postcard-schema/src/impls/nalgebra_v0_34.rs b/source/postcard-schema/src/impls/nalgebra_v0_34.rs index 504aa2a0..9732c50c 100644 --- a/source/postcard-schema/src/impls/nalgebra_v0_34.rs +++ b/source/postcard-schema/src/impls/nalgebra_v0_34.rs @@ -32,6 +32,14 @@ impl Schema for nalgebra_v0_34::Quaternion::SCHEMA; } +#[cfg_attr(docsrs, doc(cfg(feature = "nalgebra-v0_34")))] +impl Schema for nalgebra_v0_34::Point +where + T: Schema + nalgebra_v0_34::Scalar, +{ + const SCHEMA: &'static NamedType = nalgebra_v0_34::SVector::::SCHEMA; +} + /// Const version of the const-unstable [`<[[T; N]]>::as_flattened()`] const fn flatten(slice: &[[T; N]]) -> &[T] { const {