Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica

Module block

Module block 

Structs§

BlockRange
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).
ItemFlags
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.
SplittableString
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§

EmbedPrelim
Prelim container for types passed over to [Text::insert_embed] and [Text::insert_embed_with_attributes] methods.
ItemContent
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.

Type Aliases§

ClientID
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.