/// Insert an object with the `Loc` trait into the container at
/// its location.
///
/// This inserts all of `data` at the Range of length `data.length()`
/// that starts at `data.start()`.
///
/// # Example
///
/// ```
/// extern crate bio_types;
/// use bio::data_structures::annot_map::AnnotMap;
/// use bio_types::annot::contig::Contig;
/// use bio_types::strand::ReqStrand;
///
/// let mut gene_locs = AnnotMap::new();
/// let tma19 = Contig::new(
///     String::from("chrXI"),
///     334412,
///     (334916 - 334412),
///     ReqStrand::Reverse,
/// );
/// let assert_copy = tma19.clone();
/// gene_locs.insert_loc(tma19);
/// // Find annotations that overlap a specific query
/// let query = Contig::new(String::from("chrXI"), 334400, 100, ReqStrand::Reverse);
/// let hits: Vec<&Contig<String, ReqStrand>> = gene_locs.find(&query).map(|e| e.data()).collect();
/// assert_eq!(hits, vec![&assert_copy]);
/// ```
Insert an object with the `Loc` trait into the container at
its location.


Insert an object with the ` Loc ` trait into the container at its location .
pub fn insert_loc(&mut self, data: T) {
        let itree = self
            .refid_itrees
            .entry(data.refid().clone())
            .or_insert_with(IntervalTree::new);
        let rng = data.start()..(data.start() + (data.length() as isize));
        itree.insert(rng, data);
    }
pub fn insert_loc ( & mut self , data : T ) { let itree = self . refid_itrees . entry ( data . refid ( ) . clone ( ) ) . or_insert_with ( IntervalTree :: new ) ; let rng = data . start ( ) .. ( data . start ( ) + ( data . length ( ) as isize ) ) ; itree . insert ( rng , data ) ; }
Insert an object with the `Loc` trait into the container at
its location.
Insert an object with the ` Loc ` trait into the container at its location .
&mut self
data
T
example
```
extern crate bio_types;
use bio::data_structures::annot_map::AnnotMap;
use bio_types::annot::contig::Contig;
use bio_types::strand::ReqStrand.

let mut gene_locs = AnnotMap::new();
let tma19 = Contig::new(
String::from("chrXI"),
334412,
(334916 - 334412),
ReqStrand::Reverse,
);
let assert_copy = tma19.clone();
gene_locs.insert_loc(tma19);
Find annotations that overlap a specific query
let query = Contig::new(String::from("chrXI"), 334400, 100, ReqStrand::Reverse);
let hits: Vec<&Contig> = gene_locs.find(&query).map(|e| e.data()).collect();
assert_eq!(hits, vec![&assert_copy]);
```
` ` ` extern crate bio_types ; use bio :: data_structures :: annot_map :: AnnotMap ; use bio_types :: annot :: contig :: Contig ; use bio_types :: strand :: ReqStrand . let mut gene_locs = AnnotMap :: new () ; let tma19 = Contig :: new ( String :: from ( " chrXI " ) 334412 ( 334916 - 334412 ) ReqStrand :: Reverse ) ; let assert_copy = tma19 . clone () ; gene_locs . insert_loc ( tma19 ) ; Find annotations that overlap a specific query let query = Contig :: new ( String :: from ( " chrXI " ) 334400 100 ReqStrand :: Reverse ) ; let hits : Vec<&Contig > = gene_locs . find ( &query ) . map ( |e| e . data () ) . collect () ; assert_eq! ( hits vec! [ &assert_copy ] ) ; ` ` `