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

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§

Current line number

Current column number (byte offset, not char offset)

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

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§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.