Struct peresil::StringPoint[][src]

pub struct StringPoint<'a> {
    pub s: &'a str,
    pub offset: usize,
}

Tracks the location of parsing in a string, the most common case.

Helper methods are provided to do basic parsing tasks, such as finding literal strings.

Fields

The portion of the input string to start parsing next

How far into the original string we are

Methods

impl<'a> StringPoint<'a>
[src]

Slices the string.

Advances the point by the number of bytes. If the value is None, then no value was able to be consumed, and the result is a failure.

Advances the point if it starts with the literal.

Iterates through the identifiers and advances the point on the first matching identifier.

Trait Implementations

impl<'a> Debug for StringPoint<'a>
[src]

Formats the value using the given formatter. Read more

impl<'a> Copy for StringPoint<'a>
[src]

impl<'a> Clone for StringPoint<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> PartialEq for StringPoint<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> Eq for StringPoint<'a>
[src]

impl<'a> PartialOrd for StringPoint<'a>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a> Ord for StringPoint<'a>
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl<'a> Point for StringPoint<'a>
[src]

The initial point

Auto Trait Implementations

impl<'a> Send for StringPoint<'a>

impl<'a> Sync for StringPoint<'a>