[][src]Struct xi_rope::multiset::Mapper

pub struct Mapper<'a> {
    pub subset_amount_consumed: usize,
    // some fields omitted
}

Fields

subset_amount_consumed: usize

Methods

impl<'a> Mapper<'a>[src]

pub fn doc_index_to_subset(&mut self, i: usize) -> usize[src]

Map a coordinate in the document this subset corresponds to, to a coordinate in the subset matched by the CountMatcher. For example, if the Subset is a set of deletions and the matcher is CountMatcher::NonZero, this would map indices in the union string to indices in the tombstones string.

Will return the closest coordinate in the subset if the index is not in the subset. If the coordinate is past the end of the subset it will return one more than the largest index in the subset (i.e the length). This behaviour is suitable for mapping closed-open intervals in a string to intervals in a subset of the string.

In order to guarantee good performance, this method must be called with i values in non-decreasing order or it will panic. This allows the total cost to be O(n) where n = max(calls,ranges) over all times called on a single Mapper.

Auto Trait Implementations

impl<'a> Sync for Mapper<'a>

impl<'a> Send for Mapper<'a>

impl<'a> Unpin for Mapper<'a>

impl<'a> RefUnwindSafe for Mapper<'a>

impl<'a> UnwindSafe for Mapper<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]