Struct sqlite3_parser::lexer::Scanner [−][src]
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
Auto Trait Implementations
impl<I, S> RefUnwindSafe for Scanner<I, S> where
I: RefUnwindSafe,
S: RefUnwindSafe, [src]
I: RefUnwindSafe,
S: RefUnwindSafe,
impl<I, S> Send for Scanner<I, S> where
I: Send,
S: Send, [src]
I: Send,
S: Send,
impl<I, S> Sync for Scanner<I, S> where
I: Sync,
S: Sync, [src]
I: Sync,
S: Sync,
impl<I, S> Unpin for Scanner<I, S> where
I: Unpin,
S: Unpin, [src]
I: Unpin,
S: Unpin,
impl<I, S> UnwindSafe for Scanner<I, S> where
I: UnwindSafe,
S: UnwindSafe, [src]
I: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,