Module input

Source
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 implements ScanCursor.

  • The input provided to actual type scanners will be something that implements the ScanInput trait.

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§

ExactCompare
Marker type used to do exact, byte-for-byte string comparisons.
ExactSpace
Matches all whitespace exactly, and does not skip any.
FuzzySpace
Requires that whitespace in the pattern exists in the input, but the exact kind of space doesn’t matter.
IgnoreAsciiCase
Marker type used to do ASCII case-insensitive string comparisons.
IgnoreCase
Marker type used to do case-insensitive string comparisons.
IgnoreNonLine
Ignores all whitespace other than line breaks.
IgnoreSpace
Ignores all whitespace entirely.
NonSpace
Treat any contiguous sequence of non-space characters (according to Unicode’s definition of the \s regular expression class) as a word.
Wordish
Treat any contiguous sequence of “word” characters (according to Unicode’s definition of the \w regular expression class) or any other single character as a word.

Traits§

IntoScanCursor
Conversion into a ScanCursor.
ScanCursor
This trait defines the interface to input values that can be scanned.
ScanInput
This trait is the interface scanners use to access the input being scanned.
SkipSpace
Defines an interface for skipping whitespace.
SliceWord
Defines an interface for slicing words out of input and literal text.
StrCompare
Defines an interface for comparing two strings for equality.