aboutsummaryrefslogtreecommitdiffstats
path: root/src/document/sync.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/document/sync.rs')
-rw-r--r--src/document/sync.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/document/sync.rs b/src/document/sync.rs
index 394b10a..440718c 100644
--- a/src/document/sync.rs
+++ b/src/document/sync.rs
@@ -983,6 +983,13 @@ impl SyncSession {
self.state.their_heads.is_none() && we_ready && peer_ready == Some(false)
}
+ /// Whether the message just generated (`generate`) carries changes.
+ pub(crate) fn carrying(&self) -> bool {
+ self.sending
+ .as_ref()
+ .is_some_and(|sending| !sending.sent.is_empty())
+ }
+
/// Which session this is: a message generated from it reports its send's outcome
/// with this (`send_succeeded`, `send_failed`).
pub(crate) fn id(&self) -> u64 {