Module yrs::block

source ·

Structs§

  • Describes a consecutive range of updates (identified by their IDs).
  • Block identifier, which allows to uniquely identify any element insertion in a global scope (across different replicas of the same document). It consists of client ID (which is a unique document replica identifier) and monotonically incrementing clock value.
  • Block defines a range of consecutive updates performed by the same peer. While individual updates are always uniquely defined by their corresponding IDs, they may contain a lot of additional metadata. Block representation here is crucial, since it optimizes memory usage, available when multiple updates have been performed one after another (eg. when user is writing a sentence, individual key strokes are independent updates but they can be compresses into a single block containing an entire sentence for as long as another piece of data is not being inserted in the middle it).
  • Collection of flags attached to an Item - most of them are serializable and define specific properties of an associated Item, like:
  • A raw Item pointer. As the underlying block doesn’t move it’s in-memory location, ItemPtr can be considered a pinned object.
  • Empty type marker, which can be used by a Prelim trait implementations when no integrated value should be returned after prelim type has been integrated as a result of insertion.

Enums§

Constants§

Traits§

  • A trait used for preliminary types, that can be inserted into shared Yrs collections.

Type Aliases§

  • Globally unique client identifier. No two active peers are allowed to share the same ClientID. If that happens, following updates may cause document store to be corrupted and desync in a result.