Type Alias cola::ReplicaId

source ·
pub type ReplicaId = u64;
Expand description

A unique identifier for a Replica.

It’s very important that all Replicas in the same collaborative session have unique ReplicaIds as this type is used to distinguish between them when integrating remote edits.

Guaranteeing uniqueness is up to you.

If your editing session is not proxied through a server you control you can generate a random u64 every time a new Replica is created and be reasonably sure1 that there won’t be any collisions.


  1. you’d have to have almost 200k peers in the same editing session to reach a one-in-a-billion chance of a single collision, which is more than good enough for the kind of use cases this library is designed for.