minerva 0.2.0

Causal ordering for distributed systems
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::Replica;

/// Gossips the whole text state from `from` to `into`, carrying payloads,
/// through the witnessed owed read (S192): the receiver states its context
/// and its woven witness, the flow the field consumer runs, so the studio
/// instrument exercises what the field exercises.
pub fn gossip_text(from: &Replica, into: &mut Replica) {
    let delta = from.text_owed_witnessed(into.text_context(), into.text_woven());
    let chars = from.chars().clone();
    into.absorb_text(from.station(), &delta, &chars);
}

/// Gossips the whole cursor state from `from` to `into`.
pub fn gossip_cursors(from: &Replica, into: &mut Replica) {
    let delta = from.cursor_owed_to(into.cursor_context());
    into.absorb_cursor(from.station(), &delta);
}