[][src]Struct scanlex::ScanLines

pub struct ScanLines<R: Read> { /* fields omitted */ }

used to generate Scanner structs for each line

Implementations

impl<'a, R: Read> ScanLines<R>[src]

pub fn new(f: R) -> ScanLines<R>[src]

create a Scanner 'iterator' over all lines from a readable. This cannot be a proper Iterator because the lifetime constraint on Scanner cannot be satisfied. You need to use the explicit form:

This example is not tested
let mut iter = ScanLines::new(File::open("lines.txt")?);
while let Some(s) = iter.next() {
    let mut s = s?;
    // first token of each line
    println!("{:?}",s.get());
}

pub fn next(&'a mut self) -> Option<Result<Scanner<'a>>>[src]

call this to return a Scanner for the next line in the source.

Auto Trait Implementations

impl<R> RefUnwindSafe for ScanLines<R> where
    R: RefUnwindSafe

impl<R> Send for ScanLines<R> where
    R: Send

impl<R> Sync for ScanLines<R> where
    R: Sync

impl<R> Unpin for ScanLines<R> where
    R: Unpin

impl<R> UnwindSafe for ScanLines<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.