pub fn iter_range(&self, range: &Range<usize>) -> impl Iterator<Item = &T> {
        let ranges = split_range(range, self.head_index as usize, self.items.len());
        let (range1, range2) = match ranges {
            OneOfThree::First(_) => ((0..0), (0..0)),
            OneOfThree::Second(r) => (r, (0..0)),
            OneOfThree::Third((r1, r2)) => (r1, r2),
        };

        let first_part = self.items[range1].iter();
        let last_part = self.items[range2].iter();

        first_part.chain(last_part)
    }
/// Returns an iterator over specified range of items.
///
/// # Examples
/// ```
/// # use financial_primitives::capvec::CapVec;
/// let mut items = CapVec::<u64>::new(4);
/// items.push(1);
/// items.push(2);
/// items.push(3);
/// items.push(4);
/// let items_vec: Vec<_> = items.iter_range(&(1..3)).copied().collect();
/// assert_eq!(items_vec, vec![2, 3]);
/// ```
Returns an iterator over specified range of items.
Returns an iterator over specified range of items .
pub fn iter_range(&self, range: &Range<usize>) -> impl Iterator<Item = &T> {
        let ranges = split_range(range, self.head_index as usize, self.items.len());
        let (range1, range2) = match ranges {
            OneOfThree::First(_) => ((0..0), (0..0)),
            OneOfThree::Second(r) => (r, (0..0)),
            OneOfThree::Third((r1, r2)) => (r1, r2),
        };
        let first_part = self.items[range1].iter();
        let last_part = self.items[range2].iter();
        first_part.chain(last_part)
    }
pub fn iter_range ( & self , range : & Range < usize > ) -> impl Iterator < Item = & T > { let ranges = split_range ( range , self . head_index as usize , self . items . len ( ) ) ; let ( range1 , range2 ) = match ranges { OneOfThree :: First ( _ ) => ( ( 0 .. 0 ) , ( 0 .. 0 ) ) , OneOfThree :: Second ( r ) => ( r , ( 0 .. 0 ) ) , OneOfThree :: Third ( ( r1 , r2 ) ) => ( r1 , r2 ) , } ; let first_part = self . items [ range1 ] . iter ( ) ; let last_part = self . items [ range2 ] . iter ( ) ; first_part . chain ( last_part ) }
Returns an iterator over specified range of items.
Returns an iterator over specified range of items .
&self
range
&Range<usize>
&self
range
&Range<usize>
examples
None
use financial_primitives::capvec::capvec;
None