TreeRangeMap

Struct TreeRangeMap 

Source
pub struct TreeRangeMap { /* private fields */ }

Implementations§

Source§

impl TreeRangeMap

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Debug for TreeRangeMap

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TreeRangeMap

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl RangeMap for TreeRangeMap

Source§

fn init() -> Self

Source§

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
Source§

fn delete(&mut self, pos: usize, len: usize)

Source§

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>)>, )

should keep the shrink annotations around even if they are deleted completely
Source§

fn delete_annotation(&mut self, id: OpID)

Source§

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
Source§

fn get_annotation_pos( &self, id: OpID, ) -> Option<(Arc<Annotation>, Range<usize>)>

Source§

fn len(&self) -> usize

Source§

fn insert_directly(&mut self, pos: usize, len: usize)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.