Expand description
This module contains items related to input handling.
The short version is this:
-
Values provided as input to the user-facing scanning macros must implement
IntoScanCursor, which converts them into something that implementsScanCursor. -
The input provided to actual type scanners will be something that implements the
ScanInputtrait.
IntoScanCursor will be of interest if you are implementing a type which you want to be scannable. StrCursor will be of interest if you want to construct a specialised cursor. ScanCursor will be of interest if you are using a ^..cursor pattern to capture a cursor.
Structs§
- StrCursor
- Basic cursor implementation wrapping a string slice.
Enums§
- Exact
Compare - Marker type used to do exact, byte-for-byte string comparisons.
- Exact
Space - Matches all whitespace exactly, and does not skip any.
- Fuzzy
Space - Requires that whitespace in the pattern exists in the input, but the exact kind of space doesn’t matter.
- Ignore
Ascii Case - Marker type used to do ASCII case-insensitive string comparisons.
- Ignore
Case - Marker type used to do case-insensitive string comparisons.
- Ignore
NonLine - Ignores all whitespace other than line breaks.
- Ignore
Space - Ignores all whitespace entirely.
- NonSpace
- Treat any contiguous sequence of non-space characters (according to Unicode’s definition of the
\sregular expression class) as a word. - Wordish
- Treat any contiguous sequence of “word” characters (according to Unicode’s definition of the
\wregular expression class) or any other single character as a word.
Traits§
- Into
Scan Cursor - Conversion into a
ScanCursor. - Scan
Cursor - This trait defines the interface to input values that can be scanned.
- Scan
Input - This trait is the interface scanners use to access the input being scanned.
- Skip
Space - Defines an interface for skipping whitespace.
- Slice
Word - Defines an interface for slicing words out of input and literal text.
- StrCompare
- Defines an interface for comparing two strings for equality.