Type Definition yrs::XmlText [−][src]
pub type XmlText = XmlText;
Expand description
A shared data type used for collaborative text editing, that can be used in a context of
YXmlElement
nodee. It enables multiple users to add and remove chunks of text in efficient
manner. This type is internally represented as a mutable double-linked list of text chunks
- an optimization occurs during ytransaction_commit, which allows to squash multiple consecutively inserted characters together as a single chunk of text even between transaction boundaries in order to preserve more efficient memory model.
Just like YXmlElement
, YXmlText
can be marked with extra metadata in form of attributes.
YXmlText
structure internally uses UTF-8 encoding and its length is described in a number of
bytes rather than individual characters (a single UTF-8 code point can consist of many bytes).
Like all Yrs shared data types, YXmlText
is resistant to the problem of interleaving (situation
when characters inserted one after another may interleave with other peers concurrent inserts
after merging all updates together). In case of Yrs conflict resolution is solved by using
unique document id to determine correct and consistent ordering.