Module block
Structs§
- Block
Range - Describes a consecutive range of updates (identified by their IDs).
- ID
- 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.
- Item
- 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).
- Item
Flags - Collection of flags attached to an Item - most of them are serializable and define specific properties of an associated Item, like:
- ItemPtr
- A raw Item pointer. As the underlying block doesn’t move it’s in-memory location, ItemPtr can be considered a pinned object.
- Splittable
String - Unused
- 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§
- Embed
Prelim - Prelim container for types passed over to [Text::insert_embed] and [Text::insert_embed_with_attributes] methods.
- Item
Content - An enum describing the type of a user data content stored as part of one or more (if items were squashed) insert operations.
Constants§
- BLOCK_
GC_ REF_ NUMBER - Bit flag used to identify [Item::GC].
- BLOCK_
ITEM_ ANY_ REF_ NUMBER - Bit flag used to identify items with content of type ItemContent::Any.
- BLOCK_
ITEM_ BINARY_ REF_ NUMBER - Bit flag used to identify items with content of type ItemContent::Binary.
- BLOCK_
ITEM_ DELETED_ REF_ NUMBER - Bit flag used to identify items with content of type ItemContent::Deleted.
- BLOCK_
ITEM_ DOC_ REF_ NUMBER - Bit flag used to identify items with content of type ItemContent::Doc.
- BLOCK_
ITEM_ EMBED_ REF_ NUMBER - Bit flag used to identify items with content of type ItemContent::Embed.
- BLOCK_
ITEM_ FORMAT_ REF_ NUMBER - Bit flag used to identify items with content of type ItemContent::Format.
- BLOCK_
ITEM_ JSON_ REF_ NUMBER - Bit flag used to identify items with content of type ItemContent::JSON.
- BLOCK_
ITEM_ MOVE_ REF_ NUMBER - Bit flag used to identify items with content of type ItemContent::Move.
- BLOCK_
ITEM_ STRING_ REF_ NUMBER - Bit flag used to identify items with content of type ItemContent::String.
- BLOCK_
ITEM_ TYPE_ REF_ NUMBER - Bit flag used to identify items with content of type [ItemContent::Number].
- BLOCK_
SKIP_ REF_ NUMBER - Bit flag used to identify [Item::Skip].
- HAS_
ORIGIN - Bit flag used to tell if encoded item has left origin defined.
- HAS_
PARENT_ SUB - Bit flag used to tell if encoded item has a parent subtitle defined. Subtitles are used only for blocks which act as map-like types entries.
- HAS_
RIGHT_ ORIGIN - Bit flag used to tell if encoded item has right origin defined.
Traits§
- Prelim
- A trait used for preliminary types, that can be inserted into shared Yrs collections.