Trait scan_rules::input::ScanInput [] [src]

pub trait ScanInput<'a>: 'a + Sized + Clone {
    type ScanCursor: ScanCursor<'a>;
    type StrCompare: StrCompare;
    fn as_str(&self) -> &'a str;
    fn from_subslice(&self, subslice: &'a str) -> Self;
    fn to_cursor(&self) -> Self::ScanCursor;
}

This trait is the interface scanners use to access the input being scanned.

Associated Types

Corresponding cursor type.

Marker type used to do string comparisons.

Required Methods

Get the contents of the input as a string slice.

Create a new input from a subslice of this input's contents.

This should be used to ensure that additional state and settings (such as the string comparison marker) are preserved.

Turn the input into an independent cursor, suitable for feeding back into a user-facing scanning macro.

Implementors