Struct sqlite3_parser::lexer::Scanner[][src]

pub struct Scanner<I: Input, S: Splitter> { /* fields omitted */ }

Like a BufReader but with a growable buffer. Successive calls to the scan method will step through the 'tokens' of a file, skipping the bytes between the tokens.

Scanning stops unrecoverably at EOF, the first I/O error, or a token too large to fit in the buffer. When a scan stops, the reader may have advanced arbitrarily far past the last token.

Implementations

impl<I: Input, S: Splitter> Scanner<I, S>[src]

pub fn new(input: I, splitter: S) -> Scanner<I, S>[src]

pub fn line(&self) -> u64[src]

Current line number

pub fn column(&self) -> usize[src]

Current column number (byte offset, not char offset)

pub fn splitter(&self) -> &S[src]

pub fn reset(&mut self, input: I)[src]

Reset the scanner such that it behaves as if it had never been used.

impl<I: Input, S: Splitter> Scanner<I, S>[src]

pub fn scan(&mut self) -> Result<Option<(&'_ [u8], S::TokenType)>, S::Error>[src]

Advance the Scanner to next token. Return the token as a byte slice. Return None when the end of the input is reached. Return any error that occurs while reading the input.

Trait Implementations

impl<I: Input, S: Splitter> Debug for Scanner<I, S>[src]

Auto Trait Implementations

impl<I, S> RefUnwindSafe for Scanner<I, S> where
    I: RefUnwindSafe,
    S: RefUnwindSafe
[src]

impl<I, S> Send for Scanner<I, S> where
    I: Send,
    S: Send
[src]

impl<I, S> Sync for Scanner<I, S> where
    I: Sync,
    S: Sync
[src]

impl<I, S> Unpin for Scanner<I, S> where
    I: Unpin,
    S: Unpin
[src]

impl<I, S> UnwindSafe for Scanner<I, S> where
    I: UnwindSafe,
    S: UnwindSafe
[src]

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.