Skip to content

Commit 946f311

Browse files
committed
add serde derive to bp trees
1 parent 940696f commit 946f311

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/trees/bp/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ use lookup_query::{process_block_bwd, process_block_fwd, LOOKUP_BLOCK_SIZE};
138138
/// [`BpBuilder`]: BpBuilder
139139
/// [`BitVec`]: BitVec
140140
#[derive(Clone, Debug)]
141+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
141142
pub struct BpTree<const BLOCK_SIZE: usize = DEFAULT_BLOCK_SIZE> {
142143
vec: RsVec,
143144
min_max_tree: MinMaxTree,

src/trees/mmt.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use std::num::NonZeroUsize;
1919
///
2020
/// [`BpTree`]: crate::trees::bp::BpTree
2121
#[derive(Debug, Clone, Default, Eq, PartialEq)]
22+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2223
struct ExcessNode {
2324
/// excess from l..=r in the node [l, r]
2425
total: i64,
@@ -34,6 +35,7 @@ struct ExcessNode {
3435
///
3536
/// [`BpTree`]: crate::trees::bp::BpTree
3637
#[derive(Clone, Debug, Default)]
38+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3739
pub(crate) struct MinMaxTree {
3840
nodes: Box<[ExcessNode]>,
3941
}

0 commit comments

Comments
 (0)