pub fn slice_chunks(&self, range: Range<usize>) -> ContentRangeIter {
        let cursor = self.cursor_at_char(range.start, false);
        let node = unsafe { cursor.here_ptr().as_ref().unwrap() };
        let node_gap_start = node.str.gap_start_chars as usize;
        let local_pos = cursor.local_char_pos();

        let (at_start, skip) = if local_pos >= node_gap_start {
            (false, local_pos - node_gap_start)
        } else {
            (true, local_pos)
        };

        ContentRangeIter {
            inner: RawContentIter {
                next: Some(node), at_start
            },
            skip,
            take_len: range.end - range.start
        }
    }
/// Iterate through chunks across a character range in the document.
///
/// # Example
///
/// ```
/// # use jumprope::*;
/// let rope = JumpRope::from("xxxGreetings!xxx");
/// let mut string = String::new();
/// for (str, char_len) in rope.slice_chunks(3..rope.len_chars() - 3) {
///     assert_eq!(str.chars().count(), char_len);
///     string.push_str(str);
/// }
/// assert_eq!(string, "Greetings!");
/// ```
///
/// Or more simply:
///
/// ```
/// # use jumprope::*;
/// let rope = JumpRope::from("xxxGreetings!xxx");
/// let string = rope.slice_chunks(3..13).map(|(str, _len)| str).collect::<String>();
/// assert_eq!(string, "Greetings!");
/// ```
Iterate through chunks across a character range in the document.
Iterate through chunks across a character range in the document .
pub fn slice_chunks(&self, range: Range<usize>) -> ContentRangeIter {
        let cursor = self.cursor_at_char(range.start, false);
        let node = unsafe { cursor.here_ptr().as_ref().unwrap() };
        let node_gap_start = node.str.gap_start_chars as usize;
        let local_pos = cursor.local_char_pos();
        let (at_start, skip) = if local_pos >= node_gap_start {
            (false, local_pos - node_gap_start)
        } else {
            (true, local_pos)
        };
        ContentRangeIter {
            inner: RawContentIter {
                next: Some(node), at_start
            },
            skip,
            take_len: range.end - range.start
        }
    }
pub fn slice_chunks ( & self , range : Range < usize > ) -> ContentRangeIter { let cursor = self . cursor_at_char ( range . start , false ) ; let node = unsafe { cursor . here_ptr ( ) . as_ref ( ) . unwrap ( ) } ; let node_gap_start = node . str . gap_start_chars as usize ; let local_pos = cursor . local_char_pos ( ) ; let ( at_start , skip ) = if local_pos >= node_gap_start { ( false , local_pos - node_gap_start ) } else { ( true , local_pos ) } ; ContentRangeIter { inner : RawContentIter { next : Some ( node ) , at_start } , skip , take_len : range . end - range . start } }
Iterate through chunks across a character range in the document.
Iterate through chunks across a character range in the document .
&self
range
Range<usize>
example
None
use jumprope::*;
let rope = JumpRope::from("xxxGreetings!xxx");
let mut string = String::new();
for (str, char_len) in rope.slice_chunks(3..rope.len_chars() - 3) {
assert_eq!(str.chars().count(), char_len);
string.push_str(str);
}
assert_eq!(string, "Greetings!");
```

Or more simply.


let rope = JumpRope :: from ( " xxxGreetings!xxx " ) ; let mut string = String :: new () ; for ( str char_len ) in rope . slice_chunks ( 3 .. rope . len_chars () - 3 ) { assert_eq! ( str . chars () . count () char_len ) ; string . push_str ( str ) ; } assert_eq! ( string " Greetings! " ) ; ` ` ` Or more simply .
use jumprope::*;
let rope = JumpRope::from("xxxGreetings!xxx");
let string = rope.slice_chunks(3..13).map(|(str, _len)| str).collect::();
assert_eq!(string, "Greetings!");
```
let rope = JumpRope :: from ( " xxxGreetings!xxx " ) ; let string = rope . slice_chunks ( 3 .. 13 ) . map ( | ( str _len ) | str ) . collect :: () ; assert_eq! ( string " Greetings! " ) ; ` ` `