Struct ItemPtr
pub struct ItemPtr(/* private fields */);Expand description
Methods from Deref<Target = Item>§
pub fn encode<E>(&self, encoder: &mut E)where
E: Encoder,
pub 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.
pub 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.
pub 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.
pub 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
pub 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.
pub fn info(&self) -> u8
Trait Implementations§
§impl IntoIterator for ItemPtr
impl IntoIterator for ItemPtr
§impl TryFrom<ItemPtr> for XmlElementRef
impl TryFrom<ItemPtr> for XmlElementRef
§impl TryFrom<ItemPtr> for XmlFragmentRef
impl TryFrom<ItemPtr> for XmlFragmentRef
§impl TryFrom<ItemPtr> for XmlTextRef
impl TryFrom<ItemPtr> for XmlTextRef
impl Copy for ItemPtr
impl Eq for ItemPtr
impl Send for ItemPtr
impl Sync for ItemPtr
Auto Trait Implementations§
impl Freeze for ItemPtr
impl !RefUnwindSafe for ItemPtr
impl Unpin for ItemPtr
impl !UnwindSafe for ItemPtr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IterExt for Twhere
T: IntoIterator,
impl<T> IterExt for Twhere
T: IntoIterator,
§fn merge(self) -> MergeBounded<Self::Item>
fn merge(self) -> MergeBounded<Self::Item>
§fn merge_unbounded(self) -> MergeUnbounded<Self::Item>
fn merge_unbounded(self) -> MergeUnbounded<Self::Item>
§fn join_all(self) -> JoinAll<Self::Item>
fn join_all(self) -> JoinAll<Self::Item>
Vec of their outputs. Read more§fn try_join_all(self) -> TryJoinAll<Self::Item>
fn try_join_all(self) -> TryJoinAll<Self::Item>
Result<Vec<T>, E>. Read more§fn into_unordered_stream(self) -> FuturesUnorderedBounded<Self::Item>
fn into_unordered_stream(self) -> FuturesUnorderedBounded<Self::Item>
§fn into_unordered_stream_unbounded(self) -> FuturesUnordered<Self::Item>
fn into_unordered_stream_unbounded(self) -> FuturesUnordered<Self::Item>
§fn into_ordered_stream(self) -> FuturesOrderedBounded<Self::Item>
fn into_ordered_stream(self) -> FuturesOrderedBounded<Self::Item>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.