Struct yrs::YStickyIndex
source · pub struct YStickyIndex(/* private fields */);
Expand description
A sticky index is based on the Yjs model and is not affected by document changes. E.g. If you place a sticky index before a certain character, it will always point to this character. If you place a sticky index at the end of a type, it will always point to the end of the type.
A numeric position is often unsuited for user selections, because it does not change when content is inserted before or after.
Insert(0, 'x')('a.bc') = 'xa.bc'
Where .
is the sticky index position.
Instances of YStickyIndex
can be freed using ysticky_index_destroy
.
Trait Implementations§
source§impl From<StickyIndex> for YStickyIndex
impl From<StickyIndex> for YStickyIndex
source§fn from(value: StickyIndex) -> Self
fn from(value: StickyIndex) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for YStickyIndex
impl RefUnwindSafe for YStickyIndex
impl Send for YStickyIndex
impl Sync for YStickyIndex
impl Unpin for YStickyIndex
impl UnwindSafe for YStickyIndex
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
Mutably borrows from an owned value. Read more