pub struct TreeRangeMap { /* private fields */ }Implementations§
Source§impl TreeRangeMap
impl TreeRangeMap
Trait Implementations§
Source§impl Debug for TreeRangeMap
impl Debug for TreeRangeMap
Source§impl Default for TreeRangeMap
impl Default for TreeRangeMap
Source§impl RangeMap for TreeRangeMap
impl RangeMap for TreeRangeMap
fn init() -> Self
Source§fn insert<F>(&mut self, pos: usize, len: usize, f: F)where
F: FnMut(&Annotation) -> AnnPosRelativeToInsert,
fn insert<F>(&mut self, pos: usize, len: usize, f: F)where
F: FnMut(&Annotation) -> AnnPosRelativeToInsert,
f is used to position the annotations when they ends in the insert range
fn delete(&mut self, pos: usize, len: usize)
fn annotate(&mut self, pos: usize, len: usize, annotation: Annotation)
Source§fn adjust_annotation(
&mut self,
target_id: OpID,
lamport: u32,
patch_id: OpID,
start_shift: Option<(isize, Option<OpID>)>,
end_shift: Option<(isize, Option<OpID>)>,
)
fn adjust_annotation( &mut self, target_id: OpID, lamport: u32, patch_id: OpID, start_shift: Option<(isize, Option<OpID>)>, end_shift: Option<(isize, Option<OpID>)>, )
should keep the shrink annotations around even if they are deleted completely
fn delete_annotation(&mut self, id: OpID)
Source§fn get_annotations(&mut self, pos: usize, len: usize) -> Vec<Span>
fn get_annotations(&mut self, pos: usize, len: usize) -> Vec<Span>
TODO: need to clarify the rules when encounter an empty span on the edges
fn get_annotation_pos( &self, id: OpID, ) -> Option<(Arc<Annotation>, Range<usize>)>
fn len(&self) -> usize
fn insert_directly(&mut self, pos: usize, len: usize)
Auto Trait Implementations§
impl Freeze for TreeRangeMap
impl !RefUnwindSafe for TreeRangeMap
impl !Send for TreeRangeMap
impl !Sync for TreeRangeMap
impl Unpin for TreeRangeMap
impl !UnwindSafe for TreeRangeMap
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
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>
Converts
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>
Converts
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