diff -r 99ad55974e62 -r d5b0e496b72f src/bisection_tree/bt.rs --- a/src/bisection_tree/bt.rs Mon Dec 30 15:46:28 2024 -0500 +++ b/src/bisection_tree/bt.rs Mon Jan 06 20:29:25 2025 -0500 @@ -43,7 +43,13 @@ /// Node of a [`BT`] bisection tree. /// /// For the type and const parameteres, see the [module level documentation][super]. -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Serialize, Deserialize)] +#[serde(bound( + serialize = "NodeOption : Serialize, + A : Serialize,", + deserialize = "NodeOption : for<'a> Deserialize<'a>, + A : for<'a> Deserialize<'a>," +))] pub struct Node { /// The data or branches under the node. pub(super) data : NodeOption, @@ -54,7 +60,13 @@ /// Branching information of a [`Node`] of a [`BT`] bisection tree into `P` subnodes. /// /// For the type and const parameters, see the [module level documentation][super]. -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Serialize, Deserialize)] +#[serde(bound( + serialize = "[Node; P] : Serialize, + Loc : Serialize,", + deserialize = "[Node; P] : for<'a> Deserialize<'a>, + Loc : for<'a> Deserialize<'a>," +))] pub(super) struct Branches { /// Point for subdivision of the (unstored) [`Cube`] corresponding to the node. pub(super) branch_at : Loc, @@ -198,6 +210,7 @@ } /// An iterator over the $P=2^N$ subcubes of a [`Cube`] subdivided at a point `d`. +#[derive(Debug, Clone)] pub(super) struct SubcubeIter<'b, F : Float, const N : usize, const P : usize> { domain : &'b Cube, branch_at : Loc, @@ -637,7 +650,15 @@ /// It should be accessed via the [`BTImpl`] trait to hide the `const P : usize` parameter until /// const generics are flexible enough to fix `P=pow(2, N)` and thus also get rid of /// the `BTNodeLookup : BTNode` trait bound. -#[derive(Clone,Debug)] +#[derive(Clone,Debug,Serialize,Deserialize)] +#[serde(bound( + serialize = "Cube : Serialize, + M : Serialize, + >::Node : Serialize,", + deserialize = "Cube : for<'a> Deserialize<'a>, + M : for<'a> Deserialize<'a>, + >::Node : for<'a> Deserialize<'a>," +))] pub struct BT< M : Depth, F : Float,