/// Return an iterator over the bound range in the `PieceTable`.
/// Constructing the iterator takes `O(p)` time, but consuming it is constant time per element.
///
/// # Example
/// ```
/// #![feature(collections_bound)]
/// use piecetable::PieceTable;
/// use std::collections::Bound::*;
/// let src: Vec<i32> = (0..100).collect();
/// let table = PieceTable::new().src(&src);
/// assert_eq!(vec![&55, &56, &57], table.range(Included(55), Excluded(58)).collect::<Vec<&i32>>());
/// ```
Return an iterator over the bound range in the `PieceTable`.
Constructing the iterator takes `O(p)` time, but consuming it is constant time per element.
Return an iterator over the bound range in the ` PieceTable ` . Constructing the iterator takes ` O ( p ) ` time but consuming it is constant time per element .
pub fn range(&'a self, min: Bound<usize>, max: Bound<usize>) -> Range<'a, T> {
        let from = match min {
            Bound::Included(x) => x,
            Bound::Excluded(x) => x+1,
            Bound::Unbounded => 0,
        };
        let to = match max {
            Bound::Included(x) => x+1,
            Bound::Excluded(x) => x,
            Bound::Unbounded => self.length,
        };
        let iter = self.make_iter(from);
        Range {
            iter: iter,
            idx: from,
            to: to,
        }
    }
pub fn range ( & ' a self , min : Bound < usize > , max : Bound < usize > ) -> Range < ' a , T > { let from = match min { Bound :: Included ( x ) => x , Bound :: Excluded ( x ) => x + 1 , Bound :: Unbounded => 0 , } ; let to = match max { Bound :: Included ( x ) => x + 1 , Bound :: Excluded ( x ) => x , Bound :: Unbounded => self . length , } ; let iter = self . make_iter ( from ) ; Range { iter : iter , idx : from , to : to , } }
Return an iterator over the bound range in the `PieceTable`.
Return an iterator over the bound range in the ` PieceTable ` .
&'a self
min
Bound<usize>
max
Bound<usize>
example
None
![feature(collections_bound)]
None