Struct pest::inputs::StrInput [] [src]

pub struct StrInput<'a> { /* fields omitted */ }

A struct useful for matching borrowed strs.

Methods

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

[src]

Creates a new StrInput from a &str.

Examples

let input = StrInput::new("asd");

assert_eq!(input.len(), 3);

Trait Implementations

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

Formats the value using the given formatter.

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

impl<'a> Hash for StrInput<'a>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

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

[src]

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

[src]

This method tests for !=.

impl<'a> Input for StrInput<'a>
[src]

[src]

Returns length of the input.

[src]

Returns whether the input is empty.

[src]

Returns the file name of the input or None in the case where it doesn't have one.

[src]

Slices the input. Read more

[src]

Returns the line - and column number of the input at pos. Read more

[src]

Returns the line of the input at pos. Read more

[src]

Tries to skip n chars at pos. Returns Some(len) with the UTF-8 length of the skipped chars position or None if there are not enough chars left to skip. Read more

[src]

Matches string at pos and returns whether it matched. Read more

[src]

Matches string at pos case insensitively and returns whether it matched. Read more

[src]

Matches if the char is within the range and returns Some(len) with the matching char's UTF-8 length if it matched or None otherwise. Read more