src/bisection_tree/support.rs

branch
dev
changeset 86
d5b0e496b72f
parent 75
e9f4550cfa18
--- a/src/bisection_tree/support.rs	Mon Dec 30 15:46:28 2024 -0500
+++ b/src/bisection_tree/support.rs	Mon Jan 06 20:29:25 2025 -0500
@@ -2,7 +2,7 @@
 /*!
 Traits for representing the support of a [`Mapping`], and analysing the mapping on a [`Cube`].
 */
-use serde::Serialize;
+use serde::{Serialize, Deserialize};
 use std::ops::{MulAssign,DivAssign,Neg};
 use crate::types::{Float, Num};
 use crate::maputil::map2;
@@ -103,7 +103,13 @@
 impl<F : Float, T : GlobalAnalysis<F, Bounds<F>>> Bounded<F> for T { }
 
 /// Shift of [`Support`] and [`Mapping`]; output of [`Support::shift`].
-#[derive(Copy,Clone,Debug,Serialize)] // Serialize! but not implemented by Loc.
+#[derive(Copy,Clone,Debug,Serialize,Deserialize)]
+#[serde(bound(
+    serialize = "Loc<F, N> : Serialize,
+                 T : Serialize,",
+    deserialize = "Loc<F, N> : for<'a> Deserialize<'a>,
+                   T : for<'a> Deserialize<'a>",
+))]
 pub struct Shift<T, F, const N : usize> {
     shift : Loc<F, N>,
     base_fn : T,

mercurial