Skip to content

Commit

Permalink
Serde for batch
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Hoffmann <antiguru@gmail.com>
  • Loading branch information
antiguru committed Sep 9, 2024
1 parent 9a43417 commit ecfe2aa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/trace/implementations/ord_neu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ mod val_batch {
///
/// The `L` parameter captures how the updates should be laid out, and `C` determines which
/// merge batcher to select.
#[derive(Serialize, Deserialize)]
#[serde(bound = "
L::KeyContainer: Serialize + for<'a> Deserialize<'a>,
L::ValContainer: Serialize + for<'a> Deserialize<'a>,
L::OffsetContainer: Serialize + for<'a> Deserialize<'a>,
L::TimeContainer: Serialize + for<'a> Deserialize<'a>,
L::DiffContainer: Serialize + for<'a> Deserialize<'a>,
")]
pub struct OrdValBatch<L: Layout> {
/// The updates themselves.
pub storage: OrdValStorage<L>,
Expand Down Expand Up @@ -719,6 +727,13 @@ mod key_batch {
///
/// The `L` parameter captures how the updates should be laid out, and `C` determines which
/// merge batcher to select.
#[derive(Serialize, Deserialize)]
#[serde(bound = "
L::KeyContainer: Serialize + for<'a> Deserialize<'a>,
L::OffsetContainer: Serialize + for<'a> Deserialize<'a>,
L::TimeContainer: Serialize + for<'a> Deserialize<'a>,
L::DiffContainer: Serialize + for<'a> Deserialize<'a>,
")]
pub struct OrdKeyBatch<L: Layout> {
/// The updates themselves.
pub storage: OrdKeyStorage<L>,
Expand Down
10 changes: 9 additions & 1 deletion src/trace/implementations/rhh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ mod val_batch {
pub diffs: L::DiffContainer,
}

impl<L: Layout> RhhValStorage<L>
impl<L: Layout> RhhValStorage<L>
where
<L::Target as Update>::Key: Default + HashOrdered,
for<'a> <L::KeyContainer as BatchContainer>::ReadItem<'a>: HashOrdered,
Expand Down Expand Up @@ -250,6 +250,14 @@ mod val_batch {
///
/// The `L` parameter captures how the updates should be laid out, and `C` determines which
/// merge batcher to select.
#[derive(Serialize, Deserialize)]
#[serde(bound = "
L::KeyContainer: Serialize + for<'a> Deserialize<'a>,
L::ValContainer: Serialize + for<'a> Deserialize<'a>,
L::OffsetContainer: Serialize + for<'a> Deserialize<'a>,
L::TimeContainer: Serialize + for<'a> Deserialize<'a>,
L::DiffContainer: Serialize + for<'a> Deserialize<'a>,
")]
pub struct RhhValBatch<L: Layout>
where
<L::Target as Update>::Key: Default + HashOrdered,
Expand Down

0 comments on commit ecfe2aa

Please sign in to comment.