[−][src]Struct rust_lapper::Lapper
Primary object of the library. The public intervals holds all the intervals and can be used for iterating / pulling values out of the tree.
Fields
intervals: Vec<Interval<T>>
Methods
impl<T: Eq + Clone> Lapper<T>
[src]
pub fn new(intervals: Vec<Interval<T>>) -> Self
[src]
pub fn len(&self) -> usize
[src]
Get the number over intervals in Lapper
pub fn cov(&self) -> usize
[src]
Get the number of positions covered by the intervals in Lapper. This provides immutable access if it has already been set, or on the fly calculation.
pub fn set_cov(&mut self) -> usize
[src]
Get the number fo positions covered by the intervals in Lapper and store it. If you are going to be using the coverage, you should set it to avoid calculating it over and over.
ⓘImportant traits for IterLapper<'a, T>pub fn iter<'a>(&'a self) -> IterLapper<'a, T>
[src]
Return an iterator over the intervals in Lapper
pub fn merge_overlaps(&mut self)
[src]
Merge any intervals that overlap with eachother within the Lapper
ⓘImportant traits for IterFind<'a, T>pub fn find<'a>(&'a self, start: usize, stop: usize) -> IterFind<'a, T>
[src]
Find all intervals that overlap start .. stop
ⓘImportant traits for IterFind<'a, T>pub fn seek<'a>(
&'a self,
start: usize,
stop: usize,
cursor: &mut usize
) -> IterFind<'a, T>
[src]
&'a self,
start: usize,
stop: usize,
cursor: &mut usize
) -> IterFind<'a, T>
Find all intevals that overlap start .. stop. This method will work when queries to this lapper are in sorted (start) order. It uses a linear search from the last query instead of a binary search. A reference to a cursor must be passed in. This reference will be modified and should be reused in the next query. This allows seek to not need to make the lapper object mutable, and thus use the same lapper accross threads.
Trait Implementations
impl<T: Eq + Clone> IntoIterator for Lapper<T>
[src]
type Item = Interval<T>
The type of the elements being iterated over.
type IntoIter = IntoIter<Self::Item>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a, T: Eq + Clone> IntoIterator for &'a Lapper<T>
[src]
type Item = &'a Interval<T>
The type of the elements being iterated over.
type IntoIter = Iter<'a, Interval<T>>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Iter<'a, Interval<T>>
[src]
impl<'a, T: Eq + Clone> IntoIterator for &'a mut Lapper<T>
[src]
type Item = &'a mut Interval<T>
The type of the elements being iterated over.
type IntoIter = IterMut<'a, Interval<T>>
Which kind of iterator are we turning this into?
fn into_iter(self) -> IterMut<'a, Interval<T>>
[src]
impl<T: Debug + Eq + Clone> Debug for Lapper<T>
[src]
Auto Trait Implementations
impl<T> Unpin for Lapper<T> where
T: Unpin,
T: Unpin,
impl<T> Sync for Lapper<T> where
T: Sync,
T: Sync,
impl<T> Send for Lapper<T> where
T: Send,
T: Send,
impl<T> UnwindSafe for Lapper<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for Lapper<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,