···72 &*commit.collection,
73 &*commit.rkey,
74 ),
075 target: link.target.into_string(),
76 };
77 let _ = b.send(link_ev); // only errors if no subscribers are connected, which is just fine.
···72 &*commit.collection,
73 &*commit.rkey,
74 ),
75+ rev: commit.rev.to_string(),
76 target: link.target.into_string(),
77 };
78 let _ = b.send(link_ev); // only errors if no subscribers are connected, which is just fine.
+11
spacedust/src/lib.rs
···1pub mod consumer;
2pub mod server;
034use serde::Serialize;
5···9 path: String,
10 origin: String,
11 target: String,
0000000012}
1314#[derive(Debug, Serialize)]
···16 operation: String,
17 source: String,
18 source_record: String,
019 subject: String,
20 // TODO: include the record too? would save clients a level of hydration
21}
···30 operation: "create".to_string(),
31 source: format!("{}:{undotted}", link.collection),
32 source_record: link.origin,
033 subject: link.target,
34 }
35 }
···1pub mod consumer;
2pub mod server;
3+pub mod subscriber;
45use serde::Serialize;
6···10 path: String,
11 origin: String,
12 target: String,
13+ rev: String,
14+}
15+16+#[derive(Debug, Serialize)]
17+#[serde(rename_all="snake_case")]
18+pub struct ClientEvent {
19+ kind: String,
20+ link: ClientLinkEvent,
21}
2223#[derive(Debug, Serialize)]
···25 operation: String,
26 source: String,
27 source_record: String,
28+ source_rev: String,
29 subject: String,
30 // TODO: include the record too? would save clients a level of hydration
31}
···40 operation: "create".to_string(),
41 source: format!("{}:{undotted}", link.collection),
42 source_record: link.origin,
43+ source_rev: link.rev,
44 subject: link.target,
45 }
46 }