Struct ukhasnet_parser::StringInput [] [src]

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

A struct useful for matching in-memory Strings.

Examples

let mut input = StringInput::new("asdasdf");

assert!(input.match_string("asd"));
assert!(input.match_string("asdf"));
assert!(!input.match_string("nope"));

Methods

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

Creates a new StringInput from a &str.

Examples

let mut input = StringInput::new("asd");

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

Trait Implementations

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

Returns length of an Input.

Returns whether an Input is empty.

Returns current position of an Input.

Set current position of an Input.

Slices an Input.

Returns the line and column of a position for an Input.

Matches string to an Input, returns whether it matched, and advances the position with string.len() in case it did. Read more

Matches string to an Input case insensitively, returns whether it matched, and advances the position with string.len() in case it did. Read more

Matches if an Input's current char is between left and right, and advances the position with one char in case it did. Read more