Expand description
A giant sack of toys and goodies to import along with parser!.
The parser!() macro will work fine without this, so you can explicitly
import the names you want to use instead of doing use aoc_parse::{parser, prelude::*};.
This includes some constants that have the same name as a built-in Rust
type: i32, usize, bool, and so on. There’s no conflict because Rust
types and constants live in separate namespaces.
Constants§
- alnum
- Matches any alphabetic or numeric character (see
char::is_alphanumeric). Returns achar. - alpha
- Matches any alphabetic character (see
char::is_alphabetic). Returns achar. - any_
char - Matches any Unicode character. Returns a
char. - big_int
- Parse a BigInt (using its
FromStrimplementation in thenum-bigintcrate, except that underscores between digits are not accepted). - big_
int_ bin - Parse a
BigIntwritten in base 2 (using itsNumimpl from thenum-bigintcrate, except that underscores between digits are not accepted). - big_
int_ hex - Parse a
BigIntwritten in base 16 (using itsNumimpl from thenum-bigintcrate, except that underscores between digits are not accepted). - big_
uint - Parse a BigUint (using its
FromStrimplementation in thenum-bigintcrate, except that underscores between digits are not accepted and a leading+sign is not accepted). - big_
uint_ bin - Parse a
BigUintwritten in base 2 (using itsNumimpl from thenum-bigintcrate, except that underscores between digits are not accepted and a leading+sign is not accepted). - big_
uint_ hex - Parse a
BigUintwritten in base 16 (using itsNumimpl from thenum-bigintcrate, except that underscores between digits are not accepted and a leading+sign is not accepted). - bool
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - digit
- Matches any ASCII decimal digit
'0'-'9'and converts it to its integer value0-9. - digit_
bin - Matches a binary digit
'0'or'1', and converts it to its integer value0or1. - digit_
hex - Matches a hexadecimal digit
'0'-'9','a'-'f', or'A'-'F', and converts it to its integer value0-15. - f32
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - f64
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - i8
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - i8_bin
- Parse an integer written in base 2, using the
from_str_radixstatic method from the Rust standard library. - i8_hex
- Parse an integer written in base 16, using the
from_str_radixstatic method from the Rust standard library. - i16
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - i32
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - i64
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - i16_bin
- Parse an integer written in base 2, using the
from_str_radixstatic method from the Rust standard library. - i16_hex
- Parse an integer written in base 16, using the
from_str_radixstatic method from the Rust standard library. - i32_bin
- Parse an integer written in base 2, using the
from_str_radixstatic method from the Rust standard library. - i32_hex
- Parse an integer written in base 16, using the
from_str_radixstatic method from the Rust standard library. - i64_bin
- Parse an integer written in base 2, using the
from_str_radixstatic method from the Rust standard library. - i64_hex
- Parse an integer written in base 16, using the
from_str_radixstatic method from the Rust standard library. - i128
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - i128_
bin - Parse an integer written in base 2, using the
from_str_radixstatic method from the Rust standard library. - i128_
hex - Parse an integer written in base 16, using the
from_str_radixstatic method from the Rust standard library. - isize
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - isize_
bin - Parse an integer written in base 2, using the
from_str_radixstatic method from the Rust standard library. - isize_
hex - Parse an integer written in base 16, using the
from_str_radixstatic method from the Rust standard library. - lower
- Matches any lowercase letter (see
char::is_lowercase). Returns achar. - u8
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - u8_bin
- Parse an integer written in base 2, using the
from_str_radixstatic method from the Rust standard library. - u8_hex
- Parse an integer written in base 16, using the
from_str_radixstatic method from the Rust standard library. - u16
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - u32
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - u64
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - u16_bin
- Parse an integer written in base 2, using the
from_str_radixstatic method from the Rust standard library. - u16_hex
- Parse an integer written in base 16, using the
from_str_radixstatic method from the Rust standard library. - u32_bin
- Parse an integer written in base 2, using the
from_str_radixstatic method from the Rust standard library. - u32_hex
- Parse an integer written in base 16, using the
from_str_radixstatic method from the Rust standard library. - u64_bin
- Parse an integer written in base 2, using the
from_str_radixstatic method from the Rust standard library. - u64_hex
- Parse an integer written in base 16, using the
from_str_radixstatic method from the Rust standard library. - u128
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - u128_
bin - Parse an integer written in base 2, using the
from_str_radixstatic method from the Rust standard library. - u128_
hex - Parse an integer written in base 16, using the
from_str_radixstatic method from the Rust standard library. - upper
- Matches any uppercase letter (see
char::is_uppercase). Returns achar. - usize
- Parse a value of a primitive type (using its
FromStrimplementation in the Rust standard library). - usize_
bin - Parse an integer written in base 2, using the
from_str_radixstatic method from the Rust standard library. - usize_
hex - Parse an integer written in base 16, using the
from_str_radixstatic method from the Rust standard library.
Traits§
- Parser
- Trait implemented by all parsers.
Functions§
- btree_
map - Convert the output of
parserfrom aVec<(K, V)>or other collection of pairs into aBTreeMap. - btree_
set - Convert the output of
parserfrom aVec<V>or other collection into aBTreeSet. - char_of
- Make a parser that matches any single character in
optionsand produces the index of that character in the list, so thatchar_of("ABCD")produces a number in0..4. - hash_
map - Convert the output of
parserfrom aVec<(K, V)>or other collection of pairs into aHashMap. - hash_
set - Convert the output of
parserfrom aVec<V>or other collection into aHashSet. - line
line(pattern)matches a single line of text that matches pattern, and the newline at the end of the line.- lines
lines(pattern)matches any number of lines of text matching pattern. Each line must be terminated by a newline,'\n'.- repeat_
sep repeat_sep(pattern, separator)matches the given pattern any number of times, separated by the separator. For example,parser!(repeat_sep(i32, ","))matches a list of comma-separated integers.- section
section(pattern)matches zero or more nonblank lines, followed by either a blank line or the end of input. The nonblank lines must match pattern.- sections
sections(pattern)matches any number of sections matching pattern. Equivalent tosection(pattern)*.- string
- Parse using
parser, but instead of converting the matched text to a Rust value, simply return it as aString. - vec_
deque - Convert the output of
parserfrom aVec<V>or other collection into aVecDeque.