[][src]Trait line_span::LineSpans

pub trait LineSpans {
    fn line_spans(&self) -> LineSpanIter;
}

Trait which implements line_spans to get a LineSpanIter.

use line_span::LineSpans;

let text = "foo\nbar\r\nbaz";

for span in text.line_spans() {
    println!("{:>2?}: {:?}", span.range(), span.as_str());
}

This will output the following:

 0.. 3: "foo"
 4.. 7: "bar"
 9..12: "baz"

Required methods

Important traits for LineSpanIter<'a>
fn line_spans(&self) -> LineSpanIter

Creates a LineSpanIter.

Loading content...

Implementations on Foreign Types

impl LineSpans for str[src]

impl LineSpans for String[src]

Loading content...

Implementors

Loading content...