Struct str_reader::StringReader
source · [−]pub struct StringReader<'a> { /* private fields */ }
Expand description
String reader.
Implementations
Create a new reader for a given input.
Arguments
input
- input string or an object that can be referenced as a string
Get the current character (if any) without advancing the input.
Get the next character or return an error if the input is empty.
Match a given character to the input and, if successful, advance the input by exactly one character. An error is returned if the input character does not match with the given one or if the input is empty.
Arguments
expected
- expected character
Skip all whitespace characters.
Match a given string to the input and, if successful, advance the input by the length of the given string. An error is returned if the input does not start with the given string.
Arguments
val
- expected string
Read until a given condition is true or until the end of the input and return the string.
Arguments
cnd
- a closure that takes a single character and returns true/false
Read one word from the input and return it. A word ends with the first whitespace character or with the end of the input. The method skips all initial whitespace characters (if any).
Read the next word and parse it. The input won’t be advanced if the word cannot be parsed.
Read a decimal integer as i8.
Read a decimal integer as u8.
Read a decimal integer as i16.
Read a decimal integer as u16.
Read a decimal integer as i32.
Read a decimal integer as u32.
Read a decimal integer as i64.
Read a decimal integer as u64.
Read a decimal integer as i128.
Read a decimal integer as u128.
Read a decimal integer as isize.
Read a decimal integer as usize.
Read a floating point number as f32.
Read a floating point number as f64.