pub struct ItemPtr(/* private fields */);
Expand description
Methods from Deref<Target = Item>§
pub fn encode<E: Encoder>(&self, encoder: &mut E)
sourcepub fn id(&self) -> &ID
pub fn id(&self) -> &ID
Returns a unique identifier of a first update contained by a current Item.
sourcepub fn contains(&self, id: &ID) -> bool
pub fn contains(&self, id: &ID) -> bool
Checks if provided id
fits inside of updates defined within bounds of current Item.
sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
Checks if current item is marked as deleted (tombstoned). Yrs uses soft item deletion mechanism, which means that deleted values are not physically erased from memory, but just marked as deleted.
sourcepub fn is_countable(&self) -> bool
pub fn is_countable(&self) -> bool
Checks if item content can be considered countable. Countable elements can be split and joined together.
sourcepub fn len(&self) -> u32
pub fn len(&self) -> u32
Returns a length of a block. For most situation it works like Item::content_len with a difference to a Text/[XmlText] contents - in order to achieve compatibility with Yjs we need to calculate string length in terms of UTF-16 character encoding. However depending on used [Encoding] scheme we may calculate string length/offsets differently.
pub fn content_len(&self, kind: OffsetKind) -> u32
sourcepub fn last_id(&self) -> ID
pub fn last_id(&self) -> ID
Returns an ID of the last element that can be considered a part of this item.