#[repr(C)]pub struct SelectionOwner {
pub high: u64,
pub low: u64,
}Expand description
WHO a cursor or selection belongs to (U1).
A 128-bit id rather than an index, because it has to survive a NETWORK: in a
shared editing session the participants are decided elsewhere - a server, a
CRDT peer id, a user account - and an engine-allocated number could not be
agreed on by two machines. SelectionId is that engine-allocated number
and stays local; this is the app’s, and the two are separate fields for
exactly that reason.
Split into two u64s rather than a u128 because this crosses the C ABI,
where u128 had no stable layout until recently and still surprises
bindings.
Fields§
§high: u64§low: u64Implementations§
Source§impl SelectionOwner
impl SelectionOwner
Sourcepub const LOCAL: Self
pub const LOCAL: Self
The person at this machine.
All-zero, so a Default selection is a local one and every existing
construction site keeps meaning what it meant.
Sourcepub const SEAT_HIGH: u64 = 0x5EA7_0000_0000_0001
pub const SEAT_HIGH: u64 = 0x5EA7_0000_0000_0001
The high half every SEAT owner carries (9b-ii-a-i-d-ii-a). A random
(v4) peer UUID never has this exact high half, and it is non-zero so a
seat owner is never “local”.
pub const fn new(high: u64, low: u64) -> Self
Trait Implementations§
Source§impl Clone for SelectionOwner
impl Clone for SelectionOwner
Source§fn clone(&self) -> SelectionOwner
fn clone(&self) -> SelectionOwner
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more