aboutsummaryrefslogtreecommitdiffstats
path: root/src/document
diff options
context:
space:
mode:
Diffstat (limited to 'src/document')
-rw-r--r--src/document/ranges.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/document/ranges.rs b/src/document/ranges.rs
index 8ae71e9..b142f90 100644
--- a/src/document/ranges.rs
+++ b/src/document/ranges.rs
@@ -23,6 +23,7 @@
use std::collections::BTreeSet;
use std::ops::Bound;
+use serde::{Deserialize, Serialize};
use sha2::{Digest, Sha256};
/// What is reconciled: 32 bytes, in the order of their bytes.
@@ -36,7 +37,7 @@ const FEW: usize = 2 * PARTS;
/// What stands for the names of a range: the same for the same names, and, but for
/// names made to collide, for no others.
-#[derive(Clone, Copy, PartialEq, Eq, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, Debug, Serialize, Deserialize)]
pub(crate) struct Fingerprint(pub(crate) [u8; 16]);
/// The names of a range added up, and how many.
@@ -82,7 +83,7 @@ pub(crate) type Upper = Option<Name>;
/// What a message says of one range, which begins where the part before ended (the
/// first, before every name) and ends at `upper`.
-#[derive(Clone, PartialEq, Eq, Debug)]
+#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
pub(crate) enum Part {
/// Nothing to say of it: it is done, or left for another message.
Skip { upper: Upper },
@@ -111,7 +112,7 @@ impl Part {
}
/// Parts in order, the last ending after every name.
-#[derive(Clone, PartialEq, Eq, Debug, Default)]
+#[derive(Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize)]
pub(crate) struct Message(pub(crate) Vec<Part>);
/// What a node makes of a message.