aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/mod.rs')
-rw-r--r--src/transport/mod.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/transport/mod.rs b/src/transport/mod.rs
index 4fa3ec3..61abe9c 100644
--- a/src/transport/mod.rs
+++ b/src/transport/mod.rs
@@ -587,6 +587,18 @@ pub(crate) struct HelloRequest {
/// The party the sender is of, in a swarm holding a store (`--store-party`): nodes of
/// one sync with the nodes its parties list, each as its party's. None elsewhere.
pub(crate) party: Option<String>,
+ /// The kind of the sender's document (`document::KIND`): nodes whose documents are of
+ /// different kinds don't sync. Said from the wire version on that carries what is a
+ /// kind's as bytes (`wire::KINDS`); a build speaking none says none, and is of the
+ /// kind there was then.
+ #[serde(skip, default = "unsaid_kind")]
+ pub(crate) kind: String,
+}
+
+/// The kind of a document whose node says none (`HelloRequest::kind`): Automerge's, the
+/// only one there was before kinds were said.
+fn unsaid_kind() -> String {
+ crate::document::KIND.to_owned()
}
/// A peer a HELLO_REPLY lists: who it is, and where the sender reaches it.
@@ -677,6 +689,9 @@ pub(crate) struct HelloReply {
pub(crate) root: Option<Vec<u8>>,
/// As `HelloRequest::party`.
pub(crate) party: Option<String>,
+ /// The kind of the sender's document, as `HelloRequest::kind` has it.
+ #[serde(skip, default = "unsaid_kind")]
+ pub(crate) kind: String,
}
/// Bytes shown as lowercase hex, e.g. run IDs in logs.