Struct scan_rules::input::StrCursor [] [src]

pub struct StrCursor<'a, Cmp = ExactCompare, Space = IgnoreSpace, Word = Wordish> where
    Cmp: StrCompare,
    Space: SkipSpace,
    Word: SliceWord
{ /* fields omitted */ }

Basic cursor implementation wrapping a string slice.

The Cmp parameter can be used to control the string comparison logic used.

Methods

impl<'a, Cmp, Space, Word> StrCursor<'a, Cmp, Space, Word> where
    Cmp: StrCompare,
    Space: SkipSpace,
    Word: SliceWord
[src]

Construct a new StrCursor with a specific offset.

The offset is logically the number of bytes which have already been consumed from the original input; these already-consumed bytes must not be included in slice.

Trait Implementations

impl<'a, Cmp: Debug, Space: Debug, Word: Debug> Debug for StrCursor<'a, Cmp, Space, Word> where
    Cmp: StrCompare,
    Space: SkipSpace,
    Word: SliceWord
[src]

Formats the value using the given formatter.

impl<'a, Cmp, Space, Word> Copy for StrCursor<'a, Cmp, Space, Word> where
    Cmp: StrCompare,
    Space: SkipSpace,
    Word: SliceWord
[src]

impl<'a, Cmp, Space, Word> Clone for StrCursor<'a, Cmp, Space, Word> where
    Cmp: StrCompare,
    Space: SkipSpace,
    Word: SliceWord
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a, Cmp, Space, Word> ScanCursor<'a> for StrCursor<'a, Cmp, Space, Word> where
    Cmp: StrCompare,
    Space: SkipSpace,
    Word: SliceWord
[src]

Corresponding scan input type.

Assert that the input has been exhausted, or that the current position is a valid place to "stop".

Scan a value from the current position. The closure will be called with all available input, and is expected to return either the scanned value, and the number of bytes of input consumed, or a reason why scanning failed. Read more

Performs the same task as try_scan, except that it does not perform whitespace stripping.

Match the provided literal term against the input. Read more

Returns the remaining input as a string slice.

Returns the number of bytes consumed by this cursor since its creation.

impl<'a, Cmp, Space, Word> ScanInput<'a> for StrCursor<'a, Cmp, Space, Word> where
    Cmp: StrCompare,
    Space: SkipSpace,
    Word: SliceWord
[src]

Corresponding cursor type.

Marker type used to do string comparisons.

Get the contents of the input as a string slice.

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

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